i dont understand the error here, where do i put the parantheses??

1 回表示 (過去 30 日間)
yasmine
yasmine 2022 年 11 月 30 日
コメント済み: yasmine 2022 年 11 月 30 日
% The command below loads the following variables:
% y: vector of output data
% t: vector of corresponding times
% yss: steady-state output
load variables.mat
S=stepinfo(y,t,yss)
% Estimate the parameters of the underdamped, second-order system:
zeta = (-log(S.Overshoot/100))/((pi^2 +(log(S.Overshoot/100)) ^2) ^0.5) % damping ratio
wn = pi/((S.PeakTime)(1-(zeta)^2)^ 0.5) % natural frequency (in rad/sec)
K = yss(wn)^2 % gain

回答 (1 件)

the cyclist
the cyclist 2022 年 11 月 30 日
It looks like on this line of your code:
wn = pi/((S.PeakTime)(1-(zeta)^2)^ 0.5)
you are assuming that MATLAB will understand that
(a)(b)
means you should mutliply a and b, but that is not valid MATLAB syntax. Perhaps you meant
wn = pi/((S.PeakTime).*(1-(zeta)^2)^ 0.5)
?
  1 件のコメント
yasmine
yasmine 2022 年 11 月 30 日
Yep it worked thank you very much!

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by