How to save the extracted features of an image in a matfile?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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:
0 comentarios
Respuestas (1)
Adam
el 2 de Mayo de 2017
Editada: Adam
el 2 de Mayo de 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 comentarios
Adam
el 2 de Mayo de 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.
Ver también
Categorías
Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!