How to inspect local variables of a function
조회 수: 16 (최근 30일)
이전 댓글 표시
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
José-Luis
2012년 9월 21일
Well, you could just return the variables you are interested in... Or am I missing something?
채택된 답변
추가 답변 (1개)
Azzi Abdelmalek
2012년 9월 21일
편집: Azzi Abdelmalek
2012년 9월 21일
declare them global in both your function and matlab command
global var1 var2 var3
댓글 수: 3
Sean de Wolski
2012년 9월 21일
So don't use globals! That's a really bad idea as it will exacerbate whatever problem you're having!
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!