<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168943</link>
    <title>MATLAB Central Newsreader - dlmwrite help!</title>
    <description>Feed for thread: dlmwrite help!</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The 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>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 08 May 2008 14:38:01 -0400</pubDate>
      <title>dlmwrite help!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168943#431063</link>
      <author>lauren_g</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I am a matlab novice so please excuse me if my question is silly!&lt;br&gt;
&lt;br&gt;
I have a variable I am trying to save as an ASCII.  The variable is double precision and each case only takes one of two values.  I initially created this variable with each case taking either the value of '0' or '255' (for imagery purposes).  I saved it using the following command which worked fine:&lt;br&gt;
&lt;br&gt;
dlmwrite('name.asc',E,'delimiter','\t','precision','%.0f')&lt;br&gt;
&lt;br&gt;
However, the program I wish to import the ASCII into needs the values to be between 0 and 9 (the actual values do not matter, so long as they are single digits).  When I have tried creating the variable so all cases have single digit values (e.g. all '0' or '1', or all '8' and '9') and saved this using the same command as above the ASCII created does not contain any numeric values - just boxes!  &lt;br&gt;
&lt;br&gt;
Does anyone know why this is?&lt;br&gt;
&lt;br&gt;
many thanks&lt;br&gt;
&lt;br&gt;
Lauren&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 08 May 2008 18:01:31 -0400</pubDate>
      <title>Re: dlmwrite help!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168943#431118</link>
      <author>dpb</author>
      <description>lauren_g wrote:&lt;br&gt;
...&lt;br&gt;
&amp;gt; I have a variable I am trying to save as an ASCII.  The variable is&lt;br&gt;
&amp;gt; double precision and each case only takes one of two values.  I&lt;br&gt;
&amp;gt; initially created this variable with each case taking either the&lt;br&gt;
&amp;gt; value of '0' or '255' (for imagery purposes).  I saved it using the&lt;br&gt;
&amp;gt; following command which worked fine: &amp;gt;&lt;br&gt;
&amp;gt; dlmwrite('name.asc',E,'delimiter','\t','precision','%.0f')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; However, the program I wish to import the ASCII into needs the values&lt;br&gt;
&amp;gt; to be between 0 and 9 (the actual values do not matter, so long as they&lt;br&gt;
&amp;gt; are single digits). When I have tried creating the variable so all cases&lt;br&gt;
&amp;gt; have single digit values (e.g. all '0' or '1', or all '8' and '9') and&lt;br&gt;
&amp;gt; saved this using the same command as above the ASCII created does not&lt;br&gt;
&amp;gt; contain any numeric values - just boxes!&lt;br&gt;
...&lt;br&gt;
&lt;br&gt;
W/O specific code to look at, not precisely, no.&lt;br&gt;
&lt;br&gt;
But, the following worked fine for me...&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;gt;&amp;gt; x = rand(10,1) % get some arbitrary data&lt;br&gt;
x =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0153&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.7468&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.4451&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.9318&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.4660&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.4186&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.8462&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.5252&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.2026&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.6721&lt;br&gt;
&amp;nbsp;&amp;gt;&amp;gt; x(x&amp;gt;0.5)=1; x(x&amp;lt;=0.5)=0 % make it bi-valued&lt;br&gt;
x =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;br&gt;
&amp;nbsp;&amp;gt;&amp;gt; dlmwrite('test.dat',x, '\t') % output it&lt;br&gt;
&amp;nbsp;&amp;gt;&amp;gt; type 'test.dat'  % check it's what wanted&lt;br&gt;
0&lt;br&gt;
1&lt;br&gt;
0&lt;br&gt;
1&lt;br&gt;
0&lt;br&gt;
0&lt;br&gt;
1&lt;br&gt;
1&lt;br&gt;
0&lt;br&gt;
1&lt;br&gt;
&lt;br&gt;
I'm stuck in a time-warp w/ Matlab R12 so don't have the alternate &lt;br&gt;
optional arguments to dlmwrite later versions have, but you don't need &lt;br&gt;
them for this purpose anyway.&lt;br&gt;
&lt;br&gt;
--&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;gt;&amp;gt;&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 08 May 2008 19:00:25 -0400</pubDate>
      <title>Re: dlmwrite help!</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168943#431128</link>
      <author>Barry Williams</author>
      <description>I'm not sure that I've got the answer to your question, &lt;br&gt;
but here's a bit more info that may make the problem &lt;br&gt;
murkier.&lt;br&gt;
&lt;br&gt;
How are you looking at the file you create?  When I open &lt;br&gt;
it in Notepad, all I see are boxes.  When I save to &lt;br&gt;
name.txt (with everything else left the same as you wrote &lt;br&gt;
it) and either type name.txt in MatLab or open in Excel, I &lt;br&gt;
see the single integers values that I have wrriten to &lt;br&gt;
name.txt.&lt;br&gt;
&lt;br&gt;
Barry&lt;br&gt;
&lt;br&gt;
lauren_g &amp;lt;lgxlg1@nottingham.ac.uk&amp;gt; wrote in message &lt;br&gt;
&amp;lt;21483080.1210257689268.JavaMail.jakarta@nitrogen.mathforum&lt;br&gt;
.org&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am a matlab novice so please excuse me if my question &lt;br&gt;
is silly!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a variable I am trying to save as an ASCII.  The &lt;br&gt;
variable is double precision and each case only takes one &lt;br&gt;
of two values.  I initially created this variable with &lt;br&gt;
each case taking either the value of '0' or '255' (for &lt;br&gt;
imagery purposes).  I saved it using the following command &lt;br&gt;
which worked fine:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; dlmwrite&lt;br&gt;
('name.asc',E,'delimiter','\t','precision','%.0f')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; However, the program I wish to import the ASCII into &lt;br&gt;
needs the values to be between 0 and 9 (the actual values &lt;br&gt;
do not matter, so long as they are single digits).  When I &lt;br&gt;
have tried creating the variable so all cases have single &lt;br&gt;
digit values (e.g. all '0' or '1', or all '8' and '9') and &lt;br&gt;
saved this using the same command as above the ASCII &lt;br&gt;
created does not contain any numeric values - just boxes!  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Does anyone know why this is?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; many thanks&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Lauren&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
