How to save values of a double for loop ?

I want to save the different values of bety2 of the following double for loop in a matrix, however my code doesn't work.
bee=zeros(16,41);
for i=1:41
for k=1:2:16
bety2=((z3(0+k:1+k,1+i:20+i)*z3(0+k:1+k,1+i:20+i)')^-1)*(z3(0+k:1+k,1+i:20+i)*...
y3(1+i:20+i));
bee(k:k+1,i:i+1)=bety2
end
end
bee should be a 16x41 matrix. Can somebody helps me with this problem ?

댓글 수: 1

Adam
Adam 2016년 1월 4일
In what way does it 'not work'? Does it crash or give the wrong size output or something else?

댓글을 달려면 로그인하십시오.

답변 (1개)

Vineeth Kartha
Vineeth Kartha 2016년 1월 6일

0 개 추천

Hi, Please provide the values of z3 and y3 and their dimensions, Also please provide the exact error message that you receive.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

Fox
2016년 1월 4일

답변:

2016년 1월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by