what is the maximum dimension size we can generate by rand function?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
as i want generate random matrices using rand fun eg. rand(m,n) what is maximum size of m & n i can use?
0 comentarios
Respuestas (2)
Azzi Abdelmalek
el 19 de Jul. de 2016
Editada: Azzi Abdelmalek
el 19 de Jul. de 2016
Type
memory
you will get Maximum possible array
a=rand
whos a
Name Size Bytes Class Attributes
a 1x1 8 double
this indicate that a is 8 bytes. you can deduce the maximum size of your array
1 comentario
Guillaume
el 19 de Jul. de 2016
Yes, the maximum array size (generated by rand or any other way) is limited by your computer memory.
If you're using a 64-bit version of matlab, an array of the maximum possible size would probably take a loooong time to generate and do any operation with.
Steven Lord
el 19 de Jul. de 2016
There's a theoretical limit that you're only likely to hit if you're using an older 32-bit version of MATLAB. This is given by the second output of the computer function. [If you're on a 64-bit machine, I feel very confident saying you don't have a machine with enough memory to create a matrix that size. I think you'd need somewhere in the hundreds or thousands of terabytes.]
There's a practical limit given by the amount of memory available to MATLAB. This can be somewhat controlled by having other applications open or (if you're using release R2015a or later) via the Array Size Limit preference in the Workspace Browser section of the Preferences for MATLAB.
And then there's the limit of how many random numbers you need for your particular application.
0 comentarios
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!