Variables are stored but not shown is the workspace?
3 ビュー (過去 30 日間)
古いコメントを表示
I type in ans=1 in command window and I can recall it and also can find it in the control tab. But the variable just does not appear in the workspace. I reviewed some questions but all of them are about functions or scripts. Please help me.
0 件のコメント
回答 (2 件)
John D'Errico
2023 年 7 月 5 日
編集済み: John D'Errico
2023 年 7 月 5 日
clear
x = 1;
ans = x+1
whos
As you can see, the variable ans does appear. HOWEVER, you should never be using ans as a variable! It is a reserved name, a variable name that will be overwritten frequently, and not under your control.
Even on my own computer, ans does show up in the workspace pane. So I am not sure what exactly you did. If you have some behavior that is confusing you, then you need to be more clear about it.
0 件のコメント
Fangjun Jiang
2023 年 7 月 5 日
The variable name "ans" is reserved by MATLAB.
type "doc ans" to read it
2 件のコメント
Fangjun Jiang
2023 年 7 月 5 日
Try the following in MATLAB Command Window
a=1;
b=2;
workspace
open a
参考
カテゴリ
Help Center および File Exchange で Multidimensional Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!