フィルターのクリア

why i am getting a blank graph

1 回表示 (過去 30 日間)
Shahrukh s
Shahrukh s 2020 年 7 月 15 日
回答済み: Walter Roberson 2020 年 7 月 15 日
omega_bar = (0:0.01:5)';
n_omega_bar = size(omega_bar,1);
for i = 1:n_omega_bar
OMG = omega_bar(i,1);
Y_bar = (OMG.^2)/(1-OMG.^2)
end
figure(1)
plot(omega_bar,abs(Y_bar(1,:)),'o')
xlim([0 5])
ylim([0 8*1e14]);

採用された回答

Walter Roberson
Walter Roberson 2020 年 7 月 15 日
Y_bar = (OMG.^2)/(1-OMG.^2)
That overwrites all of Y_bar each time. You need
Y_bar(1,i) = (OMG.^2)/(1-OMG.^2)
But your code could be simplified:
Y_bar = omega_bar.^2 ./ (1-omega_bar.^2);
No loop is needed.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by