don't display variables

15 views (last 30 days)
Andrea Daloisio
Andrea Daloisio on 11 Nov 2016
Answered: Steven Lord on 11 Nov 2016
Don't display this variable " disp('Matrici caricate:');" why?
if true
disp('Matrici caricate:');
[gcoord];
[nodes];
[elprop];
[bcdof];
[bcval];
[ff];
end

Answers (2)

Steven Lord
Steven Lord on 11 Nov 2016
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 on 11 Nov 2016
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().

Categories

Find more on Entering Commands in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!