Changing matrix size in a loop
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hi , I need to calculate a 3D matrix , say A(v,n,i) , here is code
for n=1:5
for m=-n:n
for v=1:5
A(v,n,i)=% My Fucntion
A( ~any(A,2), :,: ) = [];
A( :, ~any(A,1),: ) = [];
end
end
end
I need to calculate A as a changing size according to m values, like if m=1 , A=10x10 , if m=2 , A=9x9 and same as for negative values of m. If I calculate A like my code , I can't get inverse of A for m>1 or m<-1. Also I tried to delete zeros columns and rows of A(:,:,i) but I couldn't do it because of 3D matrix. Thanks for any help.
3 件のコメント
Geoff Hayes
2017 年 3 月 27 日
Burak - please clarify what you mean by _ can't get inverse of A for m>1 or m<-1_. What is A when either of these conditions are true? How does A become a 3D matrix when you have already stated that if m=1, A=10x10, if m=2 , A=9x9?
Geoff Hayes
2017 年 3 月 27 日
Please don't post the same question twice: https://www.mathworks.com/matlabcentral/answers/332046-matrix-size-changing-in-a-loop. If you have not received a response to your question, the modify it so that it appears as a recent update (and so is at the "top" of the queue).
Burak
2017 年 3 月 27 日
回答 (0 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!