interpret a simple matrix code
Ältere Kommentare anzeigen
I m interpret a very easy code...
I don't know some points, could you explain green sentences?
>> A=eye(4,4)
A =
Diagonal Matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
>> for x=(1:2:3) %what is this mean x=(1:2:3)
A(x,x)=x+1; % first x is line and second x is row right? hence it means (1,1), (2,2), (3,3),(4,4)
end
>> A
A =
Diagonal Matrix
2 0 0 0
0 1 0 0
0 0 4 0
0 0 0 1
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!