Assign variables to positions in matrix
Show older comments
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]?
Accepted Answer
More Answers (1)
Sean de Wolski
on 25 Mar 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 Comments
Patrick Star
on 31 Mar 2011
Sean de Wolski
on 31 Mar 2011
Note the difference in our slashes \/!
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!