To increase backward compatibility i want to replace all my “randi([m,n])” to some function that uses only rand, as people with earlier versions of MATLAB do not have randi function.
To increase backward compatibility i want to replace all my randi([m,n]) to some function
Share
If you’re talking about
randi(imax,[m,n]), you could use something like:If you mean
randi([imin,imax]), refer to the link Amro provided in the comments: Using rand in matlab to produce numbers between limits