
#1
May912, 04:00 PM

P: 774

1. The problem statement, all variables and given/known data
MATLAB uses double precision as default. How can I change this to single? so that all computations will be made using single precision. 2. Relevant equations 3. The attempt at a solution I went to: file preferences virtual reality precision: floating point: single (I changed this from double to single) However, my computations are still being made in double precision. I don't want to change a single variable to single precision (this is done using single(A)) I want to change all computations. thank you. 



#2
May912, 04:06 PM

P: 317

I do not believe there is a way to change the default arithmetic for all operations, as MATLAB variables are indeed double precision by default. Nevertheless, if you define variables to be single precision to begin with, then any operations between them will result in a single precision output.




#3
May912, 04:23 PM

P: 774

oh right i see. thank you.




#4
May912, 05:42 PM

P: 317

single and double precision matlab
I know that's not a comforting answer if you have a large code with lots of variables  sorry!



Register to reply 
Related Discussions  
Converting binary numbers to floating point format using singleprecision IEEE 754  Engineering, Comp Sci, & Technology Homework  6  
Single precision floating point  Engineering, Comp Sci, & Technology Homework  14  
Roundoff error  double precision is not enough  General Math  4  
converting 29 and 0.7 to IEEE single precision floating point  Engineering, Comp Sci, & Technology Homework  5  
singleprecision floating point  Introductory Physics Homework  0 