About running matlab in linux.
Mostrar comentarios más antiguos
Hello, I run the same program in Windows it shows Out of memory. Type HELP MEMORY for your options. Then I run it in Linux, it runs for a while and then shows killed.
does it mean it is out of memory or something else? How to resolve it? Thanks.
Respuesta aceptada
Más respuestas (1)
C Zeng
el 26 de Jun. de 2012
0 votos
7 comentarios
C Zeng
el 26 de Jun. de 2012
Walter Roberson
el 26 de Jun. de 2012
'single' is a 32 bit floating point number; it has lower range and lower precision than double precision.
class() of the variable will show the precision.
For me, class(1.5*ones(2,3,'single')) shows single. The result might have been different in earlier versions.
You need to be careful when you combine expressions with mixed data types: sometimes MATLAB will adjust expand the expression to double precision and sometimes MATLAB will narrow down to integer. For example [pi 8.3 uint8(11)] will be uint8
C Zeng
el 27 de Jun. de 2012
Walter Roberson
el 27 de Jun. de 2012
It is not possible for a numeric array to have different datatypes (and so different precisions.) You would need to use a cell array for that.
C Zeng
el 28 de Jun. de 2012
C Zeng
el 28 de Jun. de 2012
Walter Roberson
el 28 de Jun. de 2012
cell arrays have potentially data types per entry, not per dimension.
num2cell() converts numeric arrays into cell arrays.
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!