<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255859</link>
    <title>MATLAB Central Newsreader - conversion to single = out of memory?</title>
    <description>Feed for thread: conversion to single = out of memory?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 10 Jul 2009 23:59:32 -0400</pubDate>
      <title>conversion to single = out of memory?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255859#664427</link>
      <author>MZ</author>
      <description>Strange problem.&lt;br&gt;
&lt;br&gt;
When I create a variable this way...&lt;br&gt;
&lt;br&gt;
	tempdata = zeros(size(data));&lt;br&gt;
&lt;br&gt;
...everything works fine.  But when I modify the code in this way...&lt;br&gt;
&lt;br&gt;
	tempdata = single(zeros(size(data)));&lt;br&gt;
&lt;br&gt;
...I get an out of memory error.&lt;br&gt;
&lt;br&gt;
Any ideas what's going on?</description>
    </item>
    <item>
      <pubDate>Sat, 11 Jul 2009 00:25:04 -0400</pubDate>
      <title>Re: conversion to single = out of memory?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255859#664431</link>
      <author>Matt Fig</author>
      <description>Try this:&lt;br&gt;
&lt;br&gt;
tempdata = zeros(size(data),'single');</description>
    </item>
    <item>
      <pubDate>Sat, 11 Jul 2009 10:21:36 -0400</pubDate>
      <title>Re: conversion to single = out of memory?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255859#664465</link>
      <author>Titus Edelhofer</author>
      <description>&lt;br&gt;
&quot;MZ&quot; &amp;lt;mark@nospam.void&amp;gt; schrieb im Newsbeitrag &lt;br&gt;
news:9uidnShmm_94SMrXnZ2dnUVZ_t-dnZ2d@giganews.com...&lt;br&gt;
&amp;gt; Strange problem.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; When I create a variable this way...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; tempdata = zeros(size(data));&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ...everything works fine.  But when I modify the code in this way...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; tempdata = single(zeros(size(data)));&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ...I get an out of memory error.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Any ideas what's going on?&lt;br&gt;
&lt;br&gt;
I guess, I have an idea: in the second line, you create the double-zeros &lt;br&gt;
matrix, and then create another single matrix where the zeros are copied to. &lt;br&gt;
So in fact you have 1.5 times the memory then for the first line. Use the &lt;br&gt;
'single' as suggested by Matt to directly construct the single matrix &lt;br&gt;
without going through the double first ...&lt;br&gt;
&lt;br&gt;
Titus </description>
    </item>
  </channel>
</rss>

