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

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