<?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: MATLAB Basics: Nested functions</title>
	<atom:link href="http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/</link>
	<description>&#60;a href=&#34;http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=1093599&#38;objectType=author&#34;&#62;Brett&#60;/a&#62; &#38; &#60;a href=&#34;http://www.mathworks.com/matlabcentral/fileexchange/loadAuthor.do?objectId=1094142&#38;objectType=author&#34;&#62;Jiro&#60;/a&#62; share favorite user-contributed submissions from the File Exchange.</description>
	<lastBuildDate>Fri, 10 Feb 2012 16:12:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: ALT</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-11522</link>
		<dc:creator>ALT</dc:creator>
		<pubDate>Sat, 07 Jun 2008 11:53:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-11522</guid>
		<description>Thanks for this video it was very useful.
I was using 3 functions, using global variables, but now its just one function with two nested subfunctions.

You are doing a great job with your videos, they are very helpful especially for beginners like me.

Altino</description>
		<content:encoded><![CDATA[<p>Thanks for this video it was very useful.<br />
I was using 3 functions, using global variables, but now its just one function with two nested subfunctions.</p>
<p>You are doing a great job with your videos, they are very helpful especially for beginners like me.</p>
<p>Altino</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9628</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Thu, 21 Feb 2008 20:16:54 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9628</guid>
		<description>Adnyana,

It looks like you are spending 22 hours on this one function, but you are calling it so often that each call is 0.001 seconds.  My guess is this is actually quite efficient.  Maybe your algorithm can be changed to call ismember.m less often?  ismember.m has some decisions internally to decide which algorithm to use based on the lengths of the inputs.  You might be able to tweak these.

My other suggestion is this looks like a problem that might call for a computer cluster.  You can really cut down on the time needed by using more computing power.  Check out the Parallel Computing Toolbox.

Doug</description>
		<content:encoded><![CDATA[<p>Adnyana,</p>
<p>It looks like you are spending 22 hours on this one function, but you are calling it so often that each call is 0.001 seconds.  My guess is this is actually quite efficient.  Maybe your algorithm can be changed to call ismember.m less often?  ismember.m has some decisions internally to decide which algorithm to use based on the lengths of the inputs.  You might be able to tweak these.</p>
<p>My other suggestion is this looks like a problem that might call for a computer cluster.  You can really cut down on the time needed by using more computing power.  Check out the Parallel Computing Toolbox.</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adnyana</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9612</link>
		<dc:creator>adnyana</dc:creator>
		<pubDate>Thu, 21 Feb 2008 05:46:34 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9612</guid>
		<description>ind is scalar, kls and pxl are vectors
yes of course, all of those variables&#039; values are change very often, as stated in my code. kls store indexes of one class of image, pxl store indexes of one region of that class.

here is segment of the code :

function IncludeInRjPixel_1(ind) %horizontal &amp; vertical
global Wr pxl kls rw cpt;
flag = 0;
% cpt = 0;
f = 0;
while cpt index of image matrix
       case 1
           ind = ind + 1;
       case 2
           ind = ind - rw;
       case 3
           ind = ind + rw;
   end;
   if f &gt;=4
       break;
   end;
end;
includePixel(pxl); % calculate average of pixel value of index stored in pxl

this code is called very often until computation is complete

so i can&#039;t make this calculation once. so what do you think of this case sir?

thanks sir for your reply

best regard 

adnyana</description>
		<content:encoded><![CDATA[<p>ind is scalar, kls and pxl are vectors<br />
yes of course, all of those variables&#8217; values are change very often, as stated in my code. kls store indexes of one class of image, pxl store indexes of one region of that class.</p>
<p>here is segment of the code :</p>
<p>function IncludeInRjPixel_1(ind) %horizontal &amp; vertical<br />
global Wr pxl kls rw cpt;<br />
flag = 0;<br />
% cpt = 0;<br />
f = 0;<br />
while cpt index of image matrix<br />
       case 1<br />
           ind = ind + 1;<br />
       case 2<br />
           ind = ind &#8211; rw;<br />
       case 3<br />
           ind = ind + rw;<br />
   end;<br />
   if f &gt;=4<br />
       break;<br />
   end;<br />
end;<br />
includePixel(pxl); % calculate average of pixel value of index stored in pxl</p>
<p>this code is called very often until computation is complete</p>
<p>so i can&#8217;t make this calculation once. so what do you think of this case sir?</p>
<p>thanks sir for your reply</p>
<p>best regard </p>
<p>adnyana</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9592</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Tue, 19 Feb 2008 13:57:05 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9592</guid>
		<description>Adnyana,

This is great.  Now, all I need to know is &quot;What are the typical values of:

ind
kls
pxl

Are these scalars, vectors, matrices?  What are the typical sizes.  Do the values change often?  If they do not change, can you make these calculations once and then store the value?

Doug</description>
		<content:encoded><![CDATA[<p>Adnyana,</p>
<p>This is great.  Now, all I need to know is &#8220;What are the typical values of:</p>
<p>ind<br />
kls<br />
pxl</p>
<p>Are these scalars, vectors, matrices?  What are the typical sizes.  Do the values change often?  If they do not change, can you make these calculations once and then store the value?</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adnyana</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9555</link>
		<dc:creator>adnyana</dc:creator>
		<pubDate>Sat, 16 Feb 2008 10:54:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9555</guid>
		<description>sorry sir the image not appear, here i try again :

http://img151.imageshack.us/img151/2596/profilersp5.jpg</description>
		<content:encoded><![CDATA[<p>sorry sir the image not appear, here i try again :</p>
<p><a href="http://img151.imageshack.us/img151/2596/profilersp5.jpg" rel="nofollow">http://img151.imageshack.us/img151/2596/profilersp5.jpg</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adnyana</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9554</link>
		<dc:creator>adnyana</dc:creator>
		<pubDate>Sat, 16 Feb 2008 10:38:37 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9554</guid>
		<description>yes sir, i&#039;ve run profiler on this code.
but the most time was spent on the &#039;ismember&#039; function.

is there other way or other function that run faster than &#039;ismember&#039;.

i use &#039;ismember&#039; function to check if one set of data is member of other set, like this :  

  ismember(ind,kls)== 1 &amp;&amp; ismember(ind,pxl) == 0 

thanks a lot sir for helping me

best regard

adnyana</description>
		<content:encoded><![CDATA[<p>yes sir, i&#8217;ve run profiler on this code.<br />
but the most time was spent on the &#8216;ismember&#8217; function.</p>
<p>is there other way or other function that run faster than &#8216;ismember&#8217;.</p>
<p>i use &#8216;ismember&#8217; function to check if one set of data is member of other set, like this :  </p>
<p>  ismember(ind,kls)== 1 &amp;&amp; ismember(ind,pxl) == 0 </p>
<p>thanks a lot sir for helping me</p>
<p>best regard</p>
<p>adnyana</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9541</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Fri, 15 Feb 2008 17:58:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9541</guid>
		<description>Adnyana,

I think that you would want to run the profiler on this code, it will tell you where the slow parts are.  From there, we could figure out how to speed it up.

profiler:
http://blogs.mathworks.com/pick/2006/10/19/profiler-to-find-code-bottlenecks/

Doug</description>
		<content:encoded><![CDATA[<p>Adnyana,</p>
<p>I think that you would want to run the profiler on this code, it will tell you where the slow parts are.  From there, we could figure out how to speed it up.</p>
<p>profiler:<br />
<a href="http://blogs.mathworks.com/pick/2006/10/19/profiler-to-find-code-bottlenecks/" rel="nofollow">http://blogs.mathworks.com/pick/2006/10/19/profiler-to-find-code-bottlenecks/</a></p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adnyana</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9536</link>
		<dc:creator>adnyana</dc:creator>
		<pubDate>Fri, 15 Feb 2008 10:17:28 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9536</guid>
		<description>MR. Doug, i want ask you something. I have a problem in doing
subdivision of segmented image into piecewise of images. but this
program(code) need much time to complete computation of image 512x512
pixel(need about 3 thousand second for one iteration). here is the code
:

function hasil = Subdivision1(cls,img,img_asli,sigma)

global Wr pxl kls rw img_asl img_result cpt;

    .....etc....

[Long code deleted from comment -Doug]

Mr. Doug please help me
i need your suggestion 

thanks a lot
best regard

adnyana</description>
		<content:encoded><![CDATA[<p>MR. Doug, i want ask you something. I have a problem in doing<br />
subdivision of segmented image into piecewise of images. but this<br />
program(code) need much time to complete computation of image 512&#215;512<br />
pixel(need about 3 thousand second for one iteration). here is the code<br />
:</p>
<p>function hasil = Subdivision1(cls,img,img_asli,sigma)</p>
<p>global Wr pxl kls rw img_asl img_result cpt;</p>
<p>    &#8230;..etc&#8230;.</p>
<p>[Long code deleted from comment -Doug]</p>
<p>Mr. Doug please help me<br />
i need your suggestion </p>
<p>thanks a lot<br />
best regard</p>
<p>adnyana</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9259</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Tue, 05 Feb 2008 13:47:36 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9259</guid>
		<description>In iTunes, you can subscribe to the RSS feed and it will find the podcasts that I embed into the pages.

Doug</description>
		<content:encoded><![CDATA[<p>In iTunes, you can subscribe to the RSS feed and it will find the podcasts that I embed into the pages.</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maria C Marcano</title>
		<link>http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9238</link>
		<dc:creator>Maria C Marcano</dc:creator>
		<pubDate>Tue, 05 Feb 2008 03:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2008/02/01/matlab-basics-nested-functions/#comment-9238</guid>
		<description>Is there a way to suscribe to these demos as podcasts, or do I need to come and download them from the page each week?
Thanks!</description>
		<content:encoded><![CDATA[<p>Is there a way to suscribe to these demos as podcasts, or do I need to come and download them from the page each week?<br />
Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

