I want to give a condition on the random function.

1 次查看(过去 30 天)
I want to output only the values between 1 and 0.5, using the random function. A=rand>0.5 --> A between 1 and 0.5 example A =0.6, 0.7, 0.755, 0.954 others.. Hint plz....

回答(1 个)

the cyclist
the cyclist 2015-6-15
编辑:the cyclist 2015-6-15
A = 0.5 + 0.5*rand(N,1)
where N is the number of values you want.

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by