Creating a loop for a Matrix
이전 댓글 표시
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
Jan
2011년 10월 20일
Please post, what you have done so far.
Kevin
2011년 10월 20일
Fangjun Jiang
2011년 10월 21일
Wow, you created a matrix!
답변 (1개)
Andrei Bobrov
2011년 10월 20일
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
Kevin
2011년 10월 20일
Andrei Bobrov
2011년 10월 21일
I do not understand what you want. Read the help for each function used in the code and will understand everything.
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!