|
"MZ" <mark@nospam.void> schrieb im Newsbeitrag
news:9uidnShmm_94SMrXnZ2dnUVZ_t-dnZ2d@giganews.com...
> Strange problem.
>
> When I create a variable this way...
>
> tempdata = zeros(size(data));
>
> ...everything works fine. But when I modify the code in this way...
>
> tempdata = single(zeros(size(data)));
>
> ...I get an out of memory error.
>
> Any ideas what's going on?
I guess, I have an idea: in the second line, you create the double-zeros
matrix, and then create another single matrix where the zeros are copied to.
So in fact you have 1.5 times the memory then for the first line. Use the
'single' as suggested by Matt to directly construct the single matrix
without going through the double first ...
Titus
|