フィルターのクリア

How to dispaly result value?

1 回表示 (過去 30 日間)
Mira le
Mira le 2023 年 6 月 13 日
コメント済み: Mira le 2023 年 6 月 13 日
hello every one
I want to display results that I obtained
like this:
disp('N= '; N)
but it doesn't work

採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 6 月 13 日
編集済み: Dyuman Joshi 2023 年 6 月 13 日
Use sprintf with disp
N=5;
%Create text
str = sprintf('N=%d', N); %d is the modifier for signed integer
%see the links attached for more info
%Display
disp(str)
N=5
or use fprintf
%Directly displays or prints the text input
fprintf('N=%d', N)
N=5
  2 件のコメント
Stephen23
Stephen23 2023 年 6 月 13 日
fprintf('N=%d\n', N)
% ^^ probably with a newline afterwards
Mira le
Mira le 2023 年 6 月 13 日
Thank you so much it works

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by