don't display variables

조회 수: 18 (최근 30일)
Andrea Daloisio
Andrea Daloisio 2016년 11월 11일
답변: Steven Lord 2016년 11월 11일
Don't display this variable " disp('Matrici caricate:');" why?
if true
disp('Matrici caricate:');
[gcoord];
[nodes];
[elprop];
[bcdof];
[bcval];
[ff];
end

답변 (2개)

Steven Lord
Steven Lord 2016년 11월 11일
If you call disp, it will display the text you ordered it to display regardless of whether or not the line ends in a semicolon. For lines that don't call disp or something similar, if a line ends in a semicolon that line will not display its results in the Command Window.
Compare:
a = 1:10; % WILL NOT display anything to the Command Window when executed
b = 1:10 % WILL display the variable to the Command Window when executed
a % WILL display
b; % WILL NOT display

Image Analyst
Image Analyst 2016년 11월 11일
We don't know. You are the one saying to not display it, not us. So if you don't want to display the string 'Matrici caricate:' then simply don't pass it into disp().

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by