How to load variable listed in folder one at a time and run a script sequentially
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Octavian
el 8 de Dic. de 2013
Comentada: Octavian
el 10 de Dic. de 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 comentarios
Respuesta aceptada
Walter Roberson
el 8 de Dic. de 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) = ....
Más respuestas (0)
Ver también
Categorías
Más información sobre Debugging and Analysis 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!