How to load variable listed in folder one at a time and run a script sequentially
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Octavian
am 8 Dez. 2013
Kommentiert: Octavian
am 10 Dez. 2013
Dear all,
I have different .mat expressions (values) of the same variable VAR in a list of numerical arrays named differently stored in a folder: 'path to folder'\'array name'.VAR I want to import each VAR expression ('array name'.VAR) one at a time, run a script on the VAR value, name the output based on the 'array name' (such as 'array name'.OUTVAR), clear workspace except OUTVAR, then import the next VAR value on the list, run the same script, and iterate down the list. Please advise, I mention that 'array name' is not, say, 'file1', 'file2', but 'mark', 'john'
Many thanks,
Octavian
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 8 Dez. 2013
I suggest that instead of trying to create individual variables in the workspace for each array, that instead you use fields of a structure. For example,
ArrayName = 'mark';
results.(ArrayName) = ....
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Debugging and Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!