Variation of parameters in a range

2 ビュー (過去 30 日間)
Ciro Gallucci
Ciro Gallucci 2021 年 10 月 5 日
コメント済み: Ciro Gallucci 2021 年 10 月 5 日
Good evening Community,
maybe it's a silly question but I just started studying MATLAB. How can I vary one or more parameters within a set range?
For example, I've to vary two real parameters, 'alpha' and 'beta', in the range [-20,20]. I need this variation in order to determine the stability of a system based on the variation of parameters.
Thank you so much, have a good day!

採用された回答

Image Analyst
Image Analyst 2021 年 10 月 5 日
Maybe something like this:
numSamples = 100; % Whatever resolution you want.
alpha = linspace(-20, 20, numSamples);
beta = linspace(-20, 20, numSamples);
for ka = 1 : numSamples
thisAlpha = alpha(ka);
for kb = 1 : numSamples
thisBeta = beta(kb);
% Now do something with thisAlpha and thisBeta.
end
end
  1 件のコメント
Ciro Gallucci
Ciro Gallucci 2021 年 10 月 5 日
Thank you so much!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by