Variables not appearing in workspace
이전 댓글 표시
I created a MATLAB script that should create some variables, and they only appear in the workspace when i use CRTL+C and finish the programm. I dont think that they're availabe in the progress of the program because it doesn´t work the way it should
댓글 수: 1
José-Luis
2013년 12월 5일
Have you tried using the debugger?
답변 (4개)
Image Analyst
2013년 12월 5일
0 개 추천
I bet they are and you just need to view this: http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/
댓글 수: 1
Image Analyst
2013년 12월 5일
Do you know that there are different workspaces? A base workspace, where variables from scripts go, and local workspaces that exist only when a function is being run and vanish once you leave the function.
Juliana Corlier-Bagdasaryan
2017년 11월 6일
편집: Juliana Corlier-Bagdasaryan
2017년 11월 6일
0 개 추천
I have a related problem of variables not appearing in the workspace, but which has nothing to do with functions. If I manually create any variable (like 'test = 5'), it would not be visible in the workspace window. However, if I list variables (using 'who' or 'whos') all variables would show up. I never had this problem before, only after updating to Matlab 2017b.
I definitely think this is a bug or me misunderstanding some newly released functionality. I have tried re-installing Matlab, which helped at first. But eventually the problem returned after a few Matlab sessions (Not sure if this is somehow related to the debug mode?).
Any ideas welcome. Thanks.
댓글 수: 6
Steven Lord
2017년 11월 6일
Where (in what context) did you "manually create any variable"? Describe in more detail exactly what you did to create that variable.
Image Analyst
2017년 11월 6일
Do you have Windows? If so, you can run PSR to take screenshots. Type PSR in the search window to find it. Under Windows 10, typing in PSR will show"Steps Recorder" and you can run that to record all the screenshots as you do a series of things in MATLAB. Then save the recording and upload it here.
Stephen Devlin
2017년 11월 28일
I have this problem too, my script has no functions called other than mat labs own functions, and many variables are not showing up in the workspace. Will try and roll back to 2017a until this is fixed.
Michael Melnychuk
2020년 4월 25일
yeah same here, the problem just started
Image Analyst
2020년 4월 25일
Why is no one using psr to show us screen captures? It does not good if you just same "same here" - that does not give me any information to try to help you.
HARMONY MNCUBE
2020년 5월 30일
0 개 추천
dbstop if error
Aaron
2023년 2월 3일
0 개 추천
Also seems to depend on scoping, so a variable defined inside of a for loop for example, will not show up in the workspace afterwards (even though the iterator value is, assuming it hasn't been cleared).
Try defining outside of a dedicated scope like a loop or function.
카테고리
도움말 센터 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!