how can i ask the user for 2*2 matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to let the user enter input in matrix form
matr = input ('enter values in matrix form [a,b; c,d]');
but how can I make sure that the user input 2 columns only but whatver rows. I am new to manipulating array and matrix.
0 Kommentare
Antworten (1)
madhan ravi
am 21 Apr. 2019
Bearbeitet: madhan ravi
am 21 Apr. 2019
if size(matr,2)>2
disp('Has more than 2 Columns beware!')
end
2 Kommentare
madhan ravi
am 21 Apr. 2019
matr represents the input matrix data and 2 represents the number of columns , reading the documentation of size() will clear things for you.
doc size % in command window
help size
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!