How can you display a null/empty matrix?

7 Ansichten (letzte 30 Tage)
Smith
Smith am 14 Mär. 2014
Beantwortet: Benjamin Avants am 14 Mär. 2014
is this a way? M = [ ] disp(M)
  1 Kommentar
dpb
dpb am 14 Mär. 2014
Did you try it?
What do you want displayed and in what context?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Benjamin Avants
Benjamin Avants am 14 Mär. 2014
Your method won't display anything. You can remove the semicolon from the line that assigns a value to M and it will display like this:
M = []
M =
[]
If you want to test if it is empty use something like the following:
M = [];
if isempty(M)
disp('M is empty')
end

Community Treasure Hunt

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

Start Hunting!

Translated by