Why does the matlab command window display everything?

16 ビュー (過去 30 日間)
Imanol Fernandez de arroyabe Zabala
Imanol Fernandez de arroyabe Zabala 2021 年 12 月 31 日
コメント済み: Sulaymon Eshkabilov 2021 年 12 月 31 日
For example, when I declare variables and when I'm changing them, for every iteration of this process, it shows the variable in the command window. How do I change this so that it only shows what I tell the program to show?

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 12 月 31 日
It can be attained quite easily using semicolon operator ";", e.g.:
% This displays all simulation reults
a = 3
a = 3
for ii = 1:5
b(ii) = a*ii
end
b = 3
b = 1×2
3 6
b = 1×3
3 6 9
b = 1×4
3 6 9 12
b = 1×5
3 6 9 12 15
%% This display what a user pinpoints:
a = 3;
for ii = 1:5
b(ii) = a*ii;
end
fprintf('b(%d) = %d \n', [ii, b(ii)])
b(5) = 15
% OR
fprintf('b(3) = %d \n', b(3))
b(3) = 9
  2 件のコメント
Imanol Fernandez de arroyabe Zabala
Imanol Fernandez de arroyabe Zabala 2021 年 12 月 31 日
thank you very much!!
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 12 月 31 日
Most Welcome! Glad to be of some help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAI for Wireless についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by