round random a number
Show older comments
Hello,
Suppose we have a number "3.76" and we want to round it either to 3 or 4 in a random way, how to do it? I didn't find the proper command in Matlab.
Accepted Answer
More Answers (1)
Layan Alshuhumi
on 13 Sep 2018
0 votes
Make two variables, “Nmax” and “Nmin” and set Nmax to 5 and Nmin to 3 using the first two lines. On the third line, write the code to generate a random floating point number between 3 and 5 referencing your predefined variable
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!