how to stop variable auto display in command window
13 ビュー (過去 30 日間)
古いコメントを表示
Hi everybody,
everytime I create a variable (ie a = zeros(n,n,n)) and do operation on the matrix created like a :
for i=1:n
a(i,0,0) = log(tmp(i) / tmp(i-1);
end
the matrix is being displayed in the command window (in the for loop, matrix being displayed n times). I would like to stop that but I cannot find how. I would like the command window to display only the variables I am asking it to display via the disp function.
Anyone ?
PS : if there any shortcut that perfom the for loop ?
1 件のコメント
Jack Giunta
2019 年 10 月 15 日
Add a semicolon to the end of the lines that update variables. This will tell the command window to skip displaying these variable changes. Super helpful for debugging in iteration since you can choose which variables display updates line by line!
回答 (2 件)
Andreas Goser
2012 年 2 月 15 日
As your example code does not run at all (brackets unbalanced, zero indices), I am not sure if your real code uses the semicolon. The semicolon supresses the output.
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!