About running matlab in linux.
Show older comments
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.
Accepted Answer
More Answers (1)
C Zeng
on 26 Jun 2012
0 votes
7 Comments
C Zeng
on 26 Jun 2012
Walter Roberson
on 26 Jun 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
on 27 Jun 2012
Walter Roberson
on 27 Jun 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
on 28 Jun 2012
C Zeng
on 28 Jun 2012
Walter Roberson
on 28 Jun 2012
cell arrays have potentially data types per entry, not per dimension.
num2cell() converts numeric arrays into cell arrays.
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!