PI Controller random values

I want to generate 30 random values for Kp & Ki where Kp's range is between 1 and 10, Ki's range is between 1 and 5.. How do I do that?

回答 (1 件)

Image Analyst
Image Analyst 2013 年 4 月 12 日

0 投票

Did you look up rand() in the help? What you ask is the very first example:
Example 1
Generate values from the uniform distribution on the interval [a,b]:
r = a + (b-a).*rand(100,1);

1 件のコメント

Image Analyst
Image Analyst 2013 年 4 月 13 日
Kp = 1 + 9 * rand(1, 30)
Ki = 1 + 4 * rand(1, 30)

この質問は閉じられています。

タグ

タグが未入力です。

質問済み:

2013 年 4 月 11 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by