generate uniform random numbers between -1 and +1 in matlab
    6 views (last 30 days)
  
       Show older comments
    
    Sajid Sarwar
 on 14 Dec 2019
  
    
    
    
    
    Commented: Image Analyst
      
      
 on 14 Dec 2019
            how o generate uniform random numbers between -1 and +1 in matlab?
0 Comments
Accepted Answer
  David Hill
      
      
 on 14 Dec 2019
        2*rand()-1;
2 Comments
  Image Analyst
      
      
 on 14 Dec 2019
				Did youi look at the help for rand()?  It answers both your original question and this follow up question
randomMatrix = 2 * rand(rows, columns) - 1;
where you set rows and columns to whatever values you want.
More Answers (0)
See Also
Categories
				Find more on Random Number Generation in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!