Assign variables to positions in matrix
Afficher commentaires plus anciens
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]?
Réponse acceptée
Plus de réponses (1)
Sean de Wolski
le 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 commentaires
Patrick Star
le 31 Mar 2011
Sean de Wolski
le 31 Mar 2011
Note the difference in our slashes \/!
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!