Saving structs

3 vues (au cours des 30 derniers jours)
Tanmay
Tanmay le 21 Juin 2012
Commenté : Walter Roberson le 14 Juil 2016
I have a 4563 x 1511 struct and I want to save it for later use. I tried
save structFile.mat -struct structName
but the computer seems to get stuck at the "Busy" mode after I issue this command. Any thoughts?

Réponse acceptée

Kevin Holst
Kevin Holst le 21 Juin 2012
If you're wanting to save the structure as a structure, don't put in the -struct flag. That saves all of the fieldnames as their own variables. ( http://www.mathworks.com/help/techdoc/ref/save.html)
Just nix the '-struct' and it should work fine.
  4 commentaires
Jocelyne Beelen
Jocelyne Beelen le 14 Juil 2016
I am having this same problem, when I try that, I get the message: Error using save Unable to write file mysum.mat: No such file or directory.
I want to save my structure array with a new name.
Walter Roberson
Walter Roberson le 14 Juil 2016
Jocelyne Beelen, what is your current directory at the time you try to do the save ? You would not be permitted to save into a directory that is under the MATLAB installation directory.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by