How to display elements of Matrix by entering coordinates
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sahil Bajaj
am 29 Nov. 2015
Beantwortet: Star Strider
am 29 Nov. 2015
I want to display elements of a matrix by entering coordinates in the command window
Example:
1 0 0
0 1 0
0 0 1
if I enter disp(x(2,2));
I want to get 1
0 Kommentare
Akzeptierte Antwort
Star Strider
am 29 Nov. 2015
You have to assign the matrix to ‘x’ first:
x = [1 0 0
0 1 0
0 0 1];
disp(x(2,2))
1
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!