Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
I'm not sure if my code is correct, I think it might have gone to an infinite loop, but there are a lot of iterations like almost half a million.Please have a look at this code because it's been 2 hours,no luck.
조회 수: 1 (최근 30일)
이전 댓글 표시
This is the code
N=100; phi is a 10x100 matrix and q is a 10x500 matrix
I got the values of both phi and q and am able to plot them too.
I would be really grateful if you could help me on this one.
for t=1:500
for i=1:N+1
z(t,i)=0;
for j=1:10
z(t,i)=z(t,i)+phi(j,i).*q(j,t);
end
end
end
댓글 수: 3
Roger Stafford
2017년 11월 11일
As I pointed out in my answer, what you are doing is equivalent to matrix multiplication, and Matlab’s matrix multiplication operator, ‘*’, should be much faster.
답변 (1개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!