Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:25:08+00:00 2026-06-15T10:25:08+00:00

In matlab, I have a program that this implementation of linear support vector machines

  • 0

In matlab, I have a program that this implementation of linear support vector machines to do machine learning.

The library outputs a structure during the training phase that represents the model. This structure is to be used in the testing phase.

I would like to save this structure to a file so I don’t have to go through the training phase every time.

I have tried psychtoolbox‘s WriteStructsToText() and ReadStructsFromText(), but they fail due to a buffer overflow while reading the struct into memory.

The outputted structure is a very large amount of data (tens of megabytes), so this could be the issue.

The structure:

    -Parameters: Parameters
    -nr_class: number of classes; = 2 for regression
    -nr_feature: number of features in training data (without including the bias term)
    -bias: If >= 0, we assume one additional feature is added to the end
        of each data instance.
    -Label: label of each class; empty for regression
    -w: a nr_w-by-n matrix for the weights, where n is nr_feature
        or nr_feature+1 depending on the existence of the bias term.
        nr_w is 1 if nr_class=2 and -s is not 4 (i.e., not
        multi-class svm by Crammer and Singer). It is
        nr_class otherwise.

edit:

Anyone know how to fix this error?

>> save('mode.txt','-struct','model');
>> model = load('mode.txt');
??? Error using ==> load
Number of columns on line 1 of ASCII file C:\Users\jason\Dropbox\Homework\cs280\FINAL PROJECTO\mode.txt
must be the same as previous lines.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:25:09+00:00Added an answer on June 15, 2026 at 10:25 am

    The easiest is to save the structure to a .mat-file:

    outputStructure = yourTrainingFunction;
    
    save('someFileName.mat','-struct','outputStructure');
    

    And to load

    outputStructure = load('someFileName.mat')
    

    Be aware that if your files are very large, you may have to set the proper compatibility in the general settings of Matlab (save-file versions earlier than 7.3 cannot handle files >2GB, if I recall correctly).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MATLAB program that graphs some things and then outputs the graph
I have a Matlab program that generates a list x = 6.1692 8.1863 5.8092
I have a Matlab program that is running longer than I'd like it to.
I have a big, complex MATLAB program. Somewhere within that, the number 0 is
I have a simple Matlab program that uses a set of random number lists
I thought that latest Matlab does this automatically. I have tested the following exe
I have a written a MATLAB program that creates custom MATLAB functions on the
In my program I have currently a piece of code that looks like this
Say in Matlab I have a matrix like this: 1 2 3 4 5
I have a Matlab function that creates a cell array with matrixes inside. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.