load() into workspace?
Mostrar comentarios más antiguos
If I place load() into a m-file script, it will load into the workspace, available for the caller.
If I place it into a m-file function, I will have to pass the variable names or nest out the struct.
Is there any way to pass load() into a function and pass whatever is in it directly into the workspace, without doing a lott of messy code?
Respuesta aceptada
Más respuestas (1)
Paulo Silva
el 8 de Sept. de 2011
maybe
evalin('base', 'load(...')
2 comentarios
Knut
el 9 de Sept. de 2011
Jan
el 9 de Sept. de 2011
It is very hard to debug problems, if you create variables in other workspaces by EVALIN. Imagine you have several such functions, which run in different orders. Then it is nearly impossible to find out, who is responsible for the final value. Therefore I recommend: Data = load() and export the Data struct as output. This is not clumsy and reduces the effort for debugging tremendously.
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!