<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156806</link>
    <title>MATLAB Central Newsreader - Weird publish behavior</title>
    <description>Feed for thread: Weird publish behavior</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>Fri, 28 Sep 2007 15:22:17 -0400</pubDate>
      <title>Re: Weird publish behavior</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156806#394392</link>
      <author>Matthew Simoneau</author>
      <description>&amp;&amp; always wants an expression that evaluates to a scalar&lt;br&gt;
logical and 'false' doesn't, which is the error message&lt;br&gt;
you're seeing.  In the situation that's working for you, the&lt;br&gt;
&amp;&amp; short-circuits and the second half is never evaluated.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/logicaloperatorsshortcircuit.html"&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/logicaloperatorsshortcircuit.html&lt;/a&gt;&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 28 Sep 2007 08:16:38 -0400</pubDate>
      <title>Re: Weird publish behavior</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156806#394346</link>
      <author>Stefano Naclerio</author>
      <description>You are right! I misled 0 (or false()) with the string 'false'.&lt;br&gt;
But... I still don't understand why it doesn't give problems&lt;br&gt;
if you move the current directory to the directory where the&lt;br&gt;
input is located...&lt;br&gt;
Thanks!&lt;br&gt;
&lt;br&gt;
Stefano&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 27 Sep 2007 16:20:24 -0400</pubDate>
      <title>Re: Weird publish behavior</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156806#394238</link>
      <author>Matthew Simoneau</author>
      <description>I think I see what's going on here.  Instead of saying:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;options.evalCode = 'false';&lt;br&gt;
&lt;br&gt;
try this:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;options.evalCode = false;&lt;br&gt;
&lt;br&gt;
This option should be the scalar logical "false", and not&lt;br&gt;
the char array "false".&lt;br&gt;
&lt;br&gt;
Even so, you should be getting a better error message here.&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 27 Sep 2007 09:20:11 -0400</pubDate>
      <title>Re: Weird publish behavior</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156806#394155</link>
      <author>Stefano Naclerio</author>
      <description>I think is a kind of bug. I fixed the problem with this trick:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
root = cd;&lt;br&gt;
cd(PathName);&lt;br&gt;
publish(fullfile(PathName,FileName),options);&lt;br&gt;
cd(root);&lt;br&gt;
&lt;br&gt;
and I get everything correct. It seems like publish needs to&lt;br&gt;
have the input file in the current directory...&lt;br&gt;
I hope this can help,&lt;br&gt;
&lt;br&gt;
Stefano&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 27 Sep 2007 09:02:39 -0400</pubDate>
      <title>Weird publish behavior</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156806#394152</link>
      <author>Stefano Naclerio</author>
      <description>Hi everyone,&lt;br&gt;
&lt;br&gt;
I got recently a strange behavior with the publish function.&lt;br&gt;
My code creates a m-file with embedded html tags: this file&lt;br&gt;
is then passed to "publish" in order to generate the html. &lt;br&gt;
The part of the code which fails is the publish command, and&lt;br&gt;
it is something like &lt;br&gt;
&lt;br&gt;
%% Create html&lt;br&gt;
options.evalCode = 'false';&lt;br&gt;
options.outputDir = 'OutputPathName'; &lt;br&gt;
publish(fullfile(InputPathName,FileName),options);&lt;br&gt;
&lt;br&gt;
Where FileName is my m-file with embedded html.&lt;br&gt;
&lt;br&gt;
The problem I get is that if I choose to store the output in&lt;br&gt;
the current directory (where all the main scripts are&lt;br&gt;
located), it works; if I choose a different location it fails!! &lt;br&gt;
In both cases there is a previous routine which creates if&lt;br&gt;
necessary the required directories!&lt;br&gt;
&lt;br&gt;
The error I get is: &lt;br&gt;
&lt;br&gt;
??? Operands to the || and &amp;&amp; operators must be convertible&lt;br&gt;
to logical scalar values.&lt;br&gt;
&lt;br&gt;
Error in ==&amp;gt; publish at 109&lt;br&gt;
elseif&lt;br&gt;
~strcmpi(strrep(fullPathToScript,'/',filesep),which(file))&lt;br&gt;
&amp;&amp; ...&lt;br&gt;
&lt;br&gt;
Any idea of the problem source?!?&lt;br&gt;
&lt;br&gt;
Thanks everyone!&lt;br&gt;
&lt;br&gt;
Stefano&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
