![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1751299/image.png)
MATLAB not saving variables to workspace
조회 수: 49 (최근 30일)
이전 댓글 표시
I don't know what's wrong with my MATLAB. Every time I run the dummy.m using the F5 in the editor, all the variables are being displayed in the workspace. But when I run the NitrogenDef.m using again the F5 in the editor, all the variables used in the NitrogenDef.m are not displayed in the workspace. Any help with this? Thanks!
댓글 수: 1
abdelkader omr
2024년 8월 12일
이동: Walter Roberson
2024년 8월 12일
I saved figure as follow,but I can't find it in my workspace
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1751299/image.png)
채택된 답변
Ryan Johnson
2014년 1월 7일
That's because NitrogenDef is a function, so any variables created within it are only scoped for the life of the function (unless made global).
Comment out the first line function NitrogenDef() and it will run as a script.
댓글 수: 7
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Search Path에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!