Plz guide, if I have made this loop correct?

Hi,
I have made the loop like given below, in loof f is changing itratively. Plz confirm if I have made it correctly?
fr = 30; wr = 2*pi*fr; % reference freq
f_min = 6; f_max = 40; f_int = 2;
f = f_min:f_int:f_max
for ii = 1:length(f)
w(ii) = 2*pi*f(ii);
Rosf(ii) = (1/2)*((d_vp/vp1)+(d_rho/rho1)-(d_EP/Ep1)*(1/pi)*log(wr/w(ii))) % Intercept when Sw changes
end

답변 (1개)

Image Analyst
Image Analyst 2021년 10월 14일

0 개 추천

Looks correct to me, though I can't run it because you didn't supply many of the variables inside it. Why do you ask? Do you have doubts? You know, you can do it vectorized, without a for loop.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2021년 10월 14일

답변:

2021년 10월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by