how to print variables in command window with message

조회 수: 5 (최근 30일)
Triveni
Triveni 2015년 12월 13일
답변: Walter Roberson 2015년 12월 13일
A=[1, 3,4]
I want to print size of A is length(A) and A is print(A , length(A))

채택된 답변

Walter Roberson
Walter Roberson 2015년 12월 13일
I had to make some guesses about exactly what you want output.
varname = 'A';
varlength = length(A);
fprintf('size of %s is %d\n', varname, varlength);
fprintf('%s is', varname);
fprintf(' %g', [A(:); varlength]);
fprintf('\n');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by