MATLAB 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 numeric variable typically requires 8 bytes of memory, which is equivalent to 64 bits. This is consistent with the output from the "whos" command when a random number is assigned to a variable. The multiple-choice options presented in the discussion included various interpretations of memory usage, but the correct understanding is that MATLAB uses 8 bytes for standard double-precision floating-point numbers. The confusion arises from the incorrect options provided, as they do not accurately reflect the memory allocation for numeric types 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
Please don't double post. See my answer in the Homework section.
 

Similar threads

Replies
4
Views
11K
Replies
2
Views
3K
Replies
1
Views
2K
Replies
5
Views
3K
Replies
3
Views
3K
Replies
1
Views
15K
Replies
6
Views
5K
Back
Top