How to inspect local variables of a function
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'd like to be able to view the local variables generated during the run of a function. One way is to load them to my workspace by saving them to a file, but that could become cumbersome as the number of temporary files proliferate as I experiment with running the function with different parameters. Is there another way?
2 comentarios
José-Luis
el 21 de Sept. de 2012
Well, you could just return the variables you are interested in... Or am I missing something?
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 21 de Sept. de 2012
Editada: Azzi Abdelmalek
el 21 de Sept. de 2012
declare them global in both your function and matlab command
global var1 var2 var3
3 comentarios
Sean de Wolski
el 21 de Sept. de 2012
So don't use globals! That's a really bad idea as it will exacerbate whatever problem you're having!
Ver también
Categorías
Más información sobre Variables 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!