필터 지우기
필터 지우기

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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by