Here is a randint function, i am not having communication toolbox. How i can rewrite this statement. k = randint(1,1,10)+5;

 채택된 답변

Torsten
Torsten 2018년 9월 20일
편집: Torsten 2018년 9월 20일

0 개 추천

r = rand(1,1);
k = min(floor(10*r),9)+5

추가 답변 (1개)

Steven Lord
Steven Lord 2018년 9월 20일

0 개 추천

The recommendation in the Release Notes is to use randi instead. The equivalent call is:
randi([5, 14], [1 1])
since randint(1, 1, 10) created a number in the range [0, 9].

카테고리

도움말 센터File Exchange에서 Simscape Electrical에 대해 자세히 알아보기

질문:

2018년 9월 20일

답변:

2018년 9월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by