Creating a loop for a Matrix
Mostrar comentarios más antiguos
I have a 4x4 Matrix and need to create all the minors of the matrix. How do I use a single variable to store all the minors of Matrix A? I know you are supposed to use the nested for loops somehow.
3 comentarios
Jan
el 20 de Oct. de 2011
Please post, what you have done so far.
Kevin
el 20 de Oct. de 2011
Fangjun Jiang
el 21 de Oct. de 2011
Wow, you created a matrix!
Respuestas (1)
Andrei Bobrov
el 20 de Oct. de 2011
A=rand(4);
[j1,i1] = meshgrid(1:size(A,1));
Out = arrayfun(@(i1,j1)det(A([1:i1-1,i1+1:end],[1:j1-1,j1+1:end])),i1,j1)
2 comentarios
Kevin
el 20 de Oct. de 2011
Andrei Bobrov
el 21 de Oct. de 2011
I do not understand what you want. Read the help for each function used in the code and will understand everything.
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!