How to understand the Memory [Maximum posible Array] result ?
Mostra commenti meno recenti
Hello, Please could someone help me knowing more about the topic below ?
Function Memory(), output Maximum Posible Array: It is said on the description page ”To see how many array elements this number represents, divide by the number of bytes in the array class. For example, for a double array, divide by 8. The actual number of elements MATLAB can create is always fewer than this number.” How do we know the “number of bytes in the array class” ? For example, for a multiple dimensional matrix 3x3x3, how many bytes consume each cell (type floating and integer values)?
Thank you in advance for your help, hoping you're having a good day. Eric
Risposta accettata
Più risposte (1)
Guillaume
il 25 Giu 2018
0 voti
As per the documentation you've quoted each element of a double array uses 8 bytes. So a 3x3x3 double array would be 27x8 = 216 bytes. The same array of type single, which uses 4 bytes per elements would be 27x4 = 108 bytes.
An array of type int64 or uint64 also uses 8 bytes per element. Type int32 or uint32 is 4 bytes, *int16 half of that and *int8 only 1 byte.
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!