I have a for loop to calculate this matrix. This have only one variable named w.
This is the for loop. The 'eVcounter' is equal to above w.
How can I save data for every loop?

 채택된 답변

Image Analyst
Image Analyst 2022년 12월 22일

2 개 추천

You need to index the arrays
w = 1.5 : 0.5 : 4.5;
for k = 1 : length(w)
eVcounter = w;
Amp = complicated Expression
% etc.
Cb(k) = invAmp(1,:) * b;
end

댓글 수: 4

빈찬 주
빈찬 주 2022년 12월 22일
Thank you ..
But , There is a problem..
The 'Amp' is 3 by 9 matrix,, so,, the inverse matrix cannot availabe...
Image Analyst
Image Analyst 2022년 12월 22일
Put commas between the three terms on each line of Amp. Then it's a 3x3 matrix.
w = 1.5 : 0.5 : 4.5;
for k = 1 : length(w)
eVcounter = w(k); % also this small change
Amp = complicated Expression
% etc.
Cb(k) = invAmp(1,:) * b;
end
Do also this small change in the above code
eVcounter = w(k);
빈찬 주
빈찬 주 2022년 12월 25일
Thank you :D

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

추가 답변 (0개)

카테고리

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

제품

릴리스

R2022a

질문:

2022년 12월 22일

댓글:

2022년 12월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by