Single and double precision matlab

  • Thread starter sara_87
  • Start date
  • #1
763
0

Homework Statement



MATLAB uses double precision as default.
How can I change this to single? so that all computations will be made using single precision.

Homework Equations





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.
 

Answers and Replies

  • #2
319
0
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
763
0
oh right i see. thank you.
 
  • #4
319
0
I know that's not a comforting answer if you have a large code with lots of variables -- sorry!
 

Related Threads on Single and double precision matlab

  • Last Post
Replies
14
Views
2K
  • Last Post
Replies
9
Views
7K
Replies
5
Views
9K
  • Last Post
Replies
10
Views
1K
Replies
3
Views
4K
Replies
3
Views
7K
Replies
6
Views
1K
Top