A number in matlab by default uses how much memory?

  • Thread starter Thread starter gpax42
  • Start date Start date
  • Tags Tags
    Matlab Memory
AI Thread Summary
In MATLAB, a default number typically uses 8 bytes of memory, which corresponds to 64 bits. This was confirmed by using the "whos" command after assigning a random number to a variable. The multiple-choice options provided did not include the correct answer of 8 bytes. The confusion arose from the options suggesting varying memory sizes based on the number's characteristics. Understanding that a byte consists of 8 bits is crucial for interpreting memory usage in MATLAB.
gpax42
Messages
25
Reaction score
0
A number in MATLAB by default uses how much memory?

my professor asked me this question today and I wasnt sure.

In MATLAB I assigned a random number to the variable x

>> x = 5.5623

and then used the "whos" command to determine how many bytes were stored. According to "whos", the number required 8 bytes of memory.

However, 8 wasnt part of the multiple choice.

the multiple choice were...

a. 64 bits
b. Depends on its length
c. 8 bits if it has no decimal, 32 bits if it has a decimal
d. 4 megabytes

could any1 shine some light on this problem for me, any advice would be much appreciated :smile:
 
Physics news on Phys.org

Similar threads

Replies
1
Views
2K
Replies
7
Views
2K
Replies
1
Views
2K
Replies
8
Views
2K
Replies
7
Views
3K
Replies
6
Views
3K
Replies
2
Views
2K
Replies
1
Views
7K
Back
Top