SciLab to Matlab transfer impedance code issue

1 回表示 (過去 30 日間)
Phillip Rauscher
Phillip Rauscher 2019 年 1 月 29 日
コメント済み: Sean de Wolski 2019 年 1 月 29 日
I was provided he attached Scilab code for a continuing ed lesson and have gone back and forth with the instructor as to why my Matlab ode wont work to find the transfer impedance like his provided scilab code does:
k_1=2000;
k_2=5000;
k_3=1000;
m_1=2.5;
m_2=5.0;
f=linspace(1,25,100);
omega= 2*pi*f;
while i<20
R_m= input('R_m for both elastic elements =');
Z_1=R_m+i*(omega*m_1-(k_1+k_3)./omega);
Z_2=R_m+i*(omega*m_2-(k_2+k_3)./omega);
M=i*k_3./omega;
Z_12=(Z_1.*Z_2-M.^2)./M;
Level=20*log10(abs(Z_12));
plot(f,Level)
i=i+1;
An=input('Another?, Yes=1, No=0');
if An==0
abort
end
end

回答 (1 件)

Sean de Wolski
Sean de Wolski 2019 年 1 月 29 日
abort
should be
break
  2 件のコメント
Phillip Rauscher
Phillip Rauscher 2019 年 1 月 29 日
Thank you for the quick reply- but it continues with the same error. If it is selected to try a new R_m value the chart continues to distort without resetting like the scilab code allows for.
Sean de Wolski
Sean de Wolski 2019 年 1 月 29 日
What's the error?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by