Assign variables to positions in matrix
Ältere Kommentare anzeigen
I'm sure this is a stupid question, but how does one define variables as positions in a matrix? For example, in matrix algebra, if I set up a matrix equation such that B=inv(A)*C, how can I define x and y such that B=[x;y]?
Akzeptierte Antwort
Weitere Antworten (1)
Sean de Wolski
am 25 Mär. 2011
B = [3;4]; %column vector
B = [3 4]; %row vector
B = [1 2; 3 4]; %2x2 matrix.
Ps
B = A\C; %is better than inv(A)*C
2 Kommentare
Patrick Star
am 31 Mär. 2011
Sean de Wolski
am 31 Mär. 2011
Note the difference in our slashes \/!
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!