Clear Filters
Clear Filters

How to save the extracted features of an image in a matfile?

2 views (last 30 days)
I've been trying to save the extracted features of the clusters in a variable in .mat file, but i'm new to matlab and don't know how to deal with .mat files So, there is the code I have wrote, not really sure if it's correct:

Answers (1)

Adam
Adam on 2 May 2017
Edited: Adam on 2 May 2017
Well, since your question is on saving a mat file, theoretically the rest of the code and problem is not relevant and
doc save
would be your first port of call. In your code you are not giving a filename to the save command. Or rather, since you are using the command form of the syntax it is interpreting what you do give as a filename which will not make sense.
I almost never use command form syntax when function form is available. Just something like
save( 'MyFilename.mat', 'imgsdb', 'IMGDB' )
should work fine. Note the quotes around the variable names. This catches a lot of people (me included, even now sometimes!) out. The variables you want to save are given to the save function as strings giving the variable name, not just passing the raw variable.
  2 Comments
Mayss Aliyeh
Mayss Aliyeh on 2 May 2017
Thank you, i'm receiving some errors, of how to save the variables of the features in IMGDB, how do we write them, if you may?
Adam
Adam on 2 May 2017
What are the errors. IMGDB appears to just be a struct so it should save fine, but if it has fancy objects attached to it some of them may potentially cause problems. At a glance, it's fields appear to just be standard types though.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!