<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using the cell mode toolbar</title>
	<atom:link href="http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/</link>
	<description>Mike works on the MATLAB Desktop team</description>
	<lastBuildDate>Fri, 10 Feb 2012 16:17:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-7989</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 10 Aug 2011 12:30:37 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-7989</guid>
		<description>@Petter,
 Cell mode really isn&#039;t meant to be used this way. It&#039;s really more for markup and does not have any meaning in the language.

 My first suggestion would be to make each of these individual logical units, such as separate functions (which you don&#039;t want), or to make your main file a function and each cell as subfunction, then call the main function and pass in the subfunctions you want to runs, and selectively execute each subfunction. You can have the zero-input case run all of them. 

Or you could guard each cell with a condition and set all the appropriate conditions before running the file. 

Finally you can play text games. For instance, get the text and use EVAL to run a sub-set. Obviously this is fragile depending on the existence of &quot;%%&#039;s&quot; that aren&#039;t cell markers
&lt;pre class=&quot;code&quot;&gt;
a = matlab.desktop.editor.getActive
cells = regexp(a.Text,&#039;%%.+?((?=%%)&#124;(?=$))&#039;,&#039;match&#039;)
eval(cells{1})
&lt;/pre&gt;

If you want to generate a new script with some subset of the original&#039;s cells:
&lt;pre class=&quot;code&quot;&gt;
n = matlab.desktop.editor.newDocument
n.Text = [cells{1} cells{3}]
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Petter,<br />
 Cell mode really isn&#8217;t meant to be used this way. It&#8217;s really more for markup and does not have any meaning in the language.</p>
<p> My first suggestion would be to make each of these individual logical units, such as separate functions (which you don&#8217;t want), or to make your main file a function and each cell as subfunction, then call the main function and pass in the subfunctions you want to runs, and selectively execute each subfunction. You can have the zero-input case run all of them. </p>
<p>Or you could guard each cell with a condition and set all the appropriate conditions before running the file. </p>
<p>Finally you can play text games. For instance, get the text and use EVAL to run a sub-set. Obviously this is fragile depending on the existence of &#8220;%%&#8217;s&#8221; that aren&#8217;t cell markers</p>
<pre class="code">
a = matlab.desktop.editor.getActive
cells = regexp(a.Text,'%%.+?((?=%%)|(?=$))','match')
eval(cells{1})
</pre>
<p>If you want to generate a new script with some subset of the original&#8217;s cells:</p>
<pre class="code">
n = matlab.desktop.editor.newDocument
n.Text = [cells{1} cells{3}]
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Petter</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-7988</link>
		<dc:creator>Petter</dc:creator>
		<pubDate>Wed, 10 Aug 2011 09:51:55 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-7988</guid>
		<description>Do you know how to execute a cell from the command window (or from another script)? I currently have like 20 scripts in a file using cell mode (I do not want 20 different files), and would like to generate a script that runs several (but not all) of them after each others (so I can take a cup of coffee).</description>
		<content:encoded><![CDATA[<p>Do you know how to execute a cell from the command window (or from another script)? I currently have like 20 scripts in a file using cell mode (I do not want 20 different files), and would like to generate a script that runs several (but not all) of them after each others (so I can take a cup of coffee).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6828</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 04 Feb 2010 15:50:37 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6828</guid>
		<description>béla,

 Not at this time, we&#039;ll take it under advisement. My apologies to your girlfriend.</description>
		<content:encoded><![CDATA[<p>béla,</p>
<p> Not at this time, we&#8217;ll take it under advisement. My apologies to your girlfriend.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: béla</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6826</link>
		<dc:creator>béla</dc:creator>
		<pubDate>Tue, 02 Feb 2010 20:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6826</guid>
		<description>hm.. got your point.. not sure..
but for example is it somehow possible to use the mouse wheel to change the values ?
It is just a bit more natural to play with the wheel, and besides.. it annoys the hell out of my girlfriend if I am clicking a lot.. :)</description>
		<content:encoded><![CDATA[<p>hm.. got your point.. not sure..<br />
but for example is it somehow possible to use the mouse wheel to change the values ?<br />
It is just a bit more natural to play with the wheel, and besides.. it annoys the hell out of my girlfriend if I am clicking a lot.. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6824</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 02 Feb 2010 17:58:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6824</guid>
		<description>béla,

 I&#039;m not sure how a scrollbar would help because (a) we&#039;d more space, and (b) the limits are unknown (scrollbars need a minimum and maximum value. How do you envision using a scrollbar for the increments?</description>
		<content:encoded><![CDATA[<p>béla,</p>
<p> I&#8217;m not sure how a scrollbar would help because (a) we&#8217;d more space, and (b) the limits are unknown (scrollbars need a minimum and maximum value. How do you envision using a scrollbar for the increments?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: béla</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6822</link>
		<dc:creator>béla</dc:creator>
		<pubDate>Tue, 02 Feb 2010 17:12:09 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6822</guid>
		<description>any chance you can get a scrollbar type tool to tweak increments ?
cheers

béla</description>
		<content:encoded><![CDATA[<p>any chance you can get a scrollbar type tool to tweak increments ?<br />
cheers</p>
<p>béla</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6315</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 29 Jun 2009 18:05:32 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6315</guid>
		<description>Thanks for that idea, Brett from &lt;a href=&quot;http://blogs.mathworks.com/pick/&quot; rel=&quot;nofollow&quot;&gt;Pick of the Week&lt;/a&gt;. That&#039;s a good use of the incrementer. If my example is the 0-order use, yours is the 1-order. I wonder what the next level is...</description>
		<content:encoded><![CDATA[<p>Thanks for that idea, Brett from <a href="http://blogs.mathworks.com/pick/" rel="nofollow">Pick of the Week</a>. That&#8217;s a good use of the incrementer. If my example is the 0-order use, yours is the 1-order. I wonder what the next level is&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett Shoelson</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6314</link>
		<dc:creator>Brett Shoelson</dc:creator>
		<pubDate>Mon, 29 Jun 2009 15:17:36 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6314</guid>
		<description>Hey Ken and Mike,
Whenever I present MATLAB in bootcamp mode (which is very often), I always highlight the utility of cell-mode editing. One of the benefits I point out is the vastly under-utilized incrementer tools--few people know what they&#039;re for. I typically will increment an initial guess at a threshold for an image, for instance.

But I also like to point out that one can get more creative with these buttons. For instance, if one wanted to try out our 6 different (IPT) algorithms for edge detection, the incrementer tools allow that, too:

%% 
algs = {&#039;Sobel&#039;,&#039;Prewitt&#039;,&#039;Roberts&#039;,&#039;LOG&#039;,&#039;Zerocross&#039;,&#039;Canny&#039;};
incr = 1; %INCREMENT HERE
imshow(edge(tissueMask,algs{incr}))
title([algs{incr} &#039; Edge Detection&#039;]) 

Cheers,
Brett</description>
		<content:encoded><![CDATA[<p>Hey Ken and Mike,<br />
Whenever I present MATLAB in bootcamp mode (which is very often), I always highlight the utility of cell-mode editing. One of the benefits I point out is the vastly under-utilized incrementer tools&#8211;few people know what they&#8217;re for. I typically will increment an initial guess at a threshold for an image, for instance.</p>
<p>But I also like to point out that one can get more creative with these buttons. For instance, if one wanted to try out our 6 different (IPT) algorithms for edge detection, the incrementer tools allow that, too:</p>
<p>%%<br />
algs = {&#8216;Sobel&#8217;,'Prewitt&#8217;,'Roberts&#8217;,'LOG&#8217;,'Zerocross&#8217;,'Canny&#8217;};<br />
incr = 1; %INCREMENT HERE<br />
imshow(edge(tissueMask,algs{incr}))<br />
title([algs{incr} ' Edge Detection']) </p>
<p>Cheers,<br />
Brett</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6291</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 11 Jun 2009 14:23:09 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6291</guid>
		<description>Guy, great point. Simulink parameters are an excellent usage of this!</description>
		<content:encoded><![CDATA[<p>Guy, great point. Simulink parameters are an excellent usage of this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy</title>
		<link>http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6290</link>
		<dc:creator>Guy</dc:creator>
		<pubDate>Thu, 11 Jun 2009 00:01:51 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/desktop/2009/06/08/using-the-cell-mode-toolbar/#comment-6290</guid>
		<description>My favorite element of the cell mode toolbar is the &quot;-+&quot; part. Since I discovered the possibilities of this feature, I use it everytime I need to tune or debug a Simulink model. 

By writing a simple script, I can change the value of a parameter (using the &quot;-+ feature&quot;), simulate the model using SIM, plot the results and see the effect. click, click, click, done. It speeds up things by 1000%.</description>
		<content:encoded><![CDATA[<p>My favorite element of the cell mode toolbar is the &#8220;-+&#8221; part. Since I discovered the possibilities of this feature, I use it everytime I need to tune or debug a Simulink model. </p>
<p>By writing a simple script, I can change the value of a parameter (using the &#8220;-+ feature&#8221;), simulate the model using SIM, plot the results and see the effect. click, click, click, done. It speeds up things by 1000%.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

