<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/256114</link>
    <title>MATLAB Central Newsreader - Can we use escape in display?</title>
    <description>Feed for thread: Can we use escape in display?</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>Tue, 14 Jul 2009 16:43:03 -0400</pubDate>
      <title>Can we use escape in display?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/256114#665216</link>
      <author>Arthur Zheng</author>
      <description>I want to display a string.&lt;br&gt;
&lt;br&gt;
using command:   display('somestring\n');&lt;br&gt;
&lt;br&gt;
and it shows on the screen that:&lt;br&gt;
somestring\n&lt;br&gt;
&lt;br&gt;
How could the newline escape '\n' be shown?</description>
    </item>
    <item>
      <pubDate>Tue, 14 Jul 2009 17:26:43 -0400</pubDate>
      <title>Re: Can we use escape in display?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/256114#665238</link>
      <author>Nathan</author>
      <description>On Jul 14, 9:43&#160;am, &quot;Arthur Zheng&quot; &amp;lt;hzhe...@gatech.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; I want to display a string.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; using command: &#160; display('somestring\n');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; and it shows on the screen that:&lt;br&gt;
&amp;gt; somestring\n&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; How could the newline escape '\n' be shown?&lt;br&gt;
&lt;br&gt;
how about:&lt;br&gt;
temp = sprintf('somestring\n');&lt;br&gt;
display(temp);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
-Nathan</description>
    </item>
    <item>
      <pubDate>Tue, 14 Jul 2009 19:01:04 -0400</pubDate>
      <title>Re: Can we use escape in display?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/256114#665269</link>
      <author>Jeremy Smith</author>
      <description>Another alternative is to input the actual new line characters.&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; disp(['Hello' char(13) 'World'])&lt;br&gt;
Hello&lt;br&gt;
World&lt;br&gt;
&lt;br&gt;
If you're building a string to write to file you'll have to decide whether you want to do Windows or Unix new lines.  &lt;br&gt;
&lt;br&gt;
% Windows&lt;br&gt;
fid = fopen('Test.txt','w+');&lt;br&gt;
S = ['Hello' char(13) char(10) 'World'];&lt;br&gt;
fwrite(fid,S);&lt;br&gt;
fclose(fid);&lt;br&gt;
&lt;br&gt;
% Unix&lt;br&gt;
fid = fopen('Test.txt','w+');&lt;br&gt;
S = ['Hello' char(10) 'World'];&lt;br&gt;
fwrite(fid,S);&lt;br&gt;
fclose(fid);</description>
    </item>
    <item>
      <pubDate>Tue, 14 Jul 2009 19:44:25 -0400</pubDate>
      <title>Re: Can we use escape in display?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/256114#665279</link>
      <author>Rune Allnor</author>
      <description>On 14 Jul, 21:01, &quot;Jeremy Smith&quot; &amp;lt;smit1...@umn.NOSPAM.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; Another alternative is to input the actual new line characters.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; disp(['Hello' char(13) 'World'])&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Hello&lt;br&gt;
&amp;gt; World&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; If you're building a string to write to file&lt;br&gt;
&lt;br&gt;
... use FPRINTF.&lt;br&gt;
&lt;br&gt;
Rune</description>
    </item>
    <item>
      <pubDate>Wed, 15 Jul 2009 00:33:03 -0400</pubDate>
      <title>Re: Can we use escape in display?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/256114#665332</link>
      <author>Arthur Zheng</author>
      <description>&quot;Jeremy Smith&quot; &amp;lt;smit1729@umn.NOSPAM.edu&amp;gt; wrote in message &amp;lt;h3iklg$nnr$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Another alternative is to input the actual new line characters.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; disp(['Hello' char(13) 'World'])&lt;br&gt;
&amp;gt; Hello&lt;br&gt;
&amp;gt; World&lt;br&gt;
&lt;br&gt;
Thanks!</description>
    </item>
  </channel>
</rss>

