MATLAB not saving variables to workspace
35 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I don't know what's wrong with my MATLAB. Every time I run the dummy.m using the F5 in the editor, all the variables are being displayed in the workspace. But when I run the NitrogenDef.m using again the F5 in the editor, all the variables used in the NitrogenDef.m are not displayed in the workspace. Any help with this? Thanks!
0 Commenti
Risposta accettata
Ryan Johnson
il 7 Gen 2014
That's because NitrogenDef is a function, so any variables created within it are only scoped for the life of the function (unless made global).
Comment out the first line function NitrogenDef() and it will run as a script.
7 Commenti
Più risposte (1)
Azzi Abdelmalek
il 7 Gen 2014
They are different type of file : script file and function file
0 Commenti
Vedere anche
Categorie
Scopri di più su Whos in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!