<?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: Essence of Indexing</title>
	<atom:link href="http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-31008</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 25 Jan 2010 17:55:45 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-31008</guid>
		<description>Matteo-

I would put your filters in to a cell array and think about how to use cellfun or arrayfun to apply them to the data.

--Loren</description>
		<content:encoded><![CDATA[<p>Matteo-</p>
<p>I would put your filters in to a cell array and think about how to use cellfun or arrayfun to apply them to the data.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matteo</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-31007</link>
		<dc:creator>matteo</dc:creator>
		<pubDate>Mon, 25 Jan 2010 17:24:40 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-31007</guid>
		<description>Loren, I think I should correct and further explain what I wrote on my previous post a few minutes ago.

What I would like to be able to do in many situations is something like this:

&lt;pre&gt;
for i=1:n
% 1) apply nth filter to raw data
% 2) save result to nth matrix of filtered data
end

I think this should be done with vectorizing of a for loop and may involve indexing. But I can&#039;t even get to write the correct for loop because I think that would require use of arrays and I am not at all familiar with those.
Could you point me in the right direction. Would this be a topic of interest for a post?

Thank you so much again.
Matteo</description>
		<content:encoded><![CDATA[<p>Loren, I think I should correct and further explain what I wrote on my previous post a few minutes ago.</p>
<p>What I would like to be able to do in many situations is something like this:</p>
<pre>
for i=1:n<br />
% 1) apply nth filter to raw data<br />
% 2) save result to nth matrix of filtered data<br />
end
<p>I think this should be done with vectorizing of a for loop and may involve indexing. But I can't even get to write the correct for loop because I think that would require use of arrays and I am not at all familiar with those.<br />
Could you point me in the right direction. Would this be a topic of interest for a post?</p>
<p>Thank you so much again.<br />
Matteo</p>
</pre>]]></content:encoded>
	</item>
	<item>
		<title>By: matteo</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-31006</link>
		<dc:creator>matteo</dc:creator>
		<pubDate>Mon, 25 Jan 2010 17:10:27 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-31006</guid>
		<description>Hello Loren,

Although I do lots of data interpretation using Matlab, I am fairly new to programming. I have a problem and I think indexing may be the solution, but I&#039;m stuck. I tried some of the blogs from you, Steve, Doug on indexing, but to no avail. I would appreciate any hint or pointing to some reference.

I am applying a gaussian filter to some data multiple times by increasing sigma and the size of the kernel. For example.
&lt;pre&gt;
H24 = fspecial(&#039;gaussian&#039;,[120 120],24);
lowp24 = imfilter(zeg1,H24,&#039;replicate&#039;);

H25 = fspecial(&#039;gaussian&#039;,[125 125],25);
lowp25 = imfilter(zeg1,H25,&#039;replicate&#039;);
&lt;/pre&gt;

I could not figure out a way to avoid doing it by hand - I have about 50 gaussian filters. I thought, no big deal, have to get the job done. But now I&#039;d like to try the differencers between consecutive results (say lowp25-lowp24) to understand when I&#039;m getting no further improvement. You can see where this is going. I have to do this kind of operations often and would like an  idea on how to write code to streamline my workflow.

Thank you.
Matteo</description>
		<content:encoded><![CDATA[<p>Hello Loren,</p>
<p>Although I do lots of data interpretation using Matlab, I am fairly new to programming. I have a problem and I think indexing may be the solution, but I&#8217;m stuck. I tried some of the blogs from you, Steve, Doug on indexing, but to no avail. I would appreciate any hint or pointing to some reference.</p>
<p>I am applying a gaussian filter to some data multiple times by increasing sigma and the size of the kernel. For example.</p>
<pre>
H24 = fspecial('gaussian',[120 120],24);
lowp24 = imfilter(zeg1,H24,'replicate');

H25 = fspecial('gaussian',[125 125],25);
lowp25 = imfilter(zeg1,H25,'replicate');
</pre>
<p>I could not figure out a way to avoid doing it by hand &#8211; I have about 50 gaussian filters. I thought, no big deal, have to get the job done. But now I&#8217;d like to try the differencers between consecutive results (say lowp25-lowp24) to understand when I&#8217;m getting no further improvement. You can see where this is going. I have to do this kind of operations often and would like an  idea on how to write code to streamline my workflow.</p>
<p>Thank you.<br />
Matteo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-23719</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Sat, 22 Dec 2007 21:38:53 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-23719</guid>
		<description>Antonio-

A singleton dimension contains only 1 index in that dimension, e.g., A(3:5,17,2:3) has the 2nd dimension as a singleton since the size of this array would be 3x1x2.

--Loren</description>
		<content:encoded><![CDATA[<p>Antonio-</p>
<p>A singleton dimension contains only 1 index in that dimension, e.g., A(3:5,17,2:3) has the 2nd dimension as a singleton since the size of this array would be 3x1x2.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Siciliano Antonio</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-23705</link>
		<dc:creator>Siciliano Antonio</dc:creator>
		<pubDate>Sat, 22 Dec 2007 15:11:04 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-23705</guid>
		<description>Can you give me a clear definition of the term &quot;singleton&quot; and simple example relating this term?
Thanks
Antonio Siciliano</description>
		<content:encoded><![CDATA[<p>Can you give me a clear definition of the term &#8220;singleton&#8221; and simple example relating this term?<br />
Thanks<br />
Antonio Siciliano</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-17117</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 10 Sep 2007 11:19:22 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-17117</guid>
		<description>Pieter-

MATLAB doesn&#039;t currently support the syntax you&#039;d like to use.    You must do the variable assignment and then index into the result. 

--Loren</description>
		<content:encoded><![CDATA[<p>Pieter-</p>
<p>MATLAB doesn&#8217;t currently support the syntax you&#8217;d like to use.    You must do the variable assignment and then index into the result. </p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pieter Laurens Baljon</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-17110</link>
		<dc:creator>Pieter Laurens Baljon</dc:creator>
		<pubDate>Mon, 10 Sep 2007 08:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-17110</guid>
		<description>Is there a way to immediately address the result of a method as in:
A = [21 23 24 25 26];
B = A( randperm(end)(1:3) );

The part of code I can&#039;t get working is &#039;randperm(end)(1:3)&#039;. I want the first three random elements from matrix A. I could get the same result with the code:
A = [21 23 24 25 26];
idx = randperm(length(A));
B = A( idx(1:3) );
but I would prefer not to use the additional variable &#039;idx&#039;.

Thanks in advance,
Pieter Laurens</description>
		<content:encoded><![CDATA[<p>Is there a way to immediately address the result of a method as in:<br />
A = [21 23 24 25 26];<br />
B = A( randperm(end)(1:3) );</p>
<p>The part of code I can&#8217;t get working is &#8216;randperm(end)(1:3)&#8217;. I want the first three random elements from matrix A. I could get the same result with the code:<br />
A = [21 23 24 25 26];<br />
idx = randperm(length(A));<br />
B = A( idx(1:3) );<br />
but I would prefer not to use the additional variable &#8216;idx&#8217;.</p>
<p>Thanks in advance,<br />
Pieter Laurens</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: I Patterson</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-16335</link>
		<dc:creator>I Patterson</dc:creator>
		<pubDate>Thu, 02 Aug 2007 06:25:15 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-16335</guid>
		<description>Hello, Definitely helpful to have all the indexing info tegether. I taught Matlab at the graduate level and once beyond the basics I then assemnled indexing tecniques into notes, explained some less obvious tecniques. I then distributed the notes and an assignment requiring the use of indexing. Seemed to work</description>
		<content:encoded><![CDATA[<p>Hello, Definitely helpful to have all the indexing info tegether. I taught Matlab at the graduate level and once beyond the basics I then assemnled indexing tecniques into notes, explained some less obvious tecniques. I then distributed the notes and an assignment requiring the use of indexing. Seemed to work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-15968</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Thu, 07 Dec 2006 02:57:57 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-15968</guid>
		<description>Erik-

Glad you were able to get your code working.  Perhaps it would be worth posting the new version here for people to compare.

I fixed your code by reinserting the &gt; and &lt;.  However, it doesn&#039;t look identical to the code you posted to the newsgroup (an if-end chunk missing).  FYI, the software doesn&#039;t remove &gt;,&lt; if they are inside the html pre tags.

--Loren</description>
		<content:encoded><![CDATA[<p>Erik-</p>
<p>Glad you were able to get your code working.  Perhaps it would be worth posting the new version here for people to compare.</p>
<p>I fixed your code by reinserting the > and < .  However, it doesn't look identical to the code you posted to the newsgroup (an if-end chunk missing).  FYI, the software doesn't remove >,< if they are inside the html pre tags.</p>
</p><p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: erik</title>
		<link>http://blogs.mathworks.com/loren/2006/08/09/essence-of-indexing/#comment-15964</link>
		<dc:creator>erik</dc:creator>
		<pubDate>Wed, 06 Dec 2006 23:04:41 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=49#comment-15964</guid>
		<description>http://blogs.mathworks.com/loren/?p=28
and
http://blogs.mathworks.com/loren/?p=65#12
were just what i needed, thanks!  i knew i was being dumb.

incidentally, the code i posted worked fine, i just thought it was ugly and knew you would know of a better way.  it does have comments that describe its specification and i think they are pretty simple, plus i posted a reference to the matlab documentation that explains the algorithm.  i did not know that pre tags were necessary to prevent the blog software from mangling code (i guess less than and greater than signs are dangerous on the web) -- i merely pasted in text from my m-file editor.  anyway, the code pasted fine into that matlab forum at:
http://newsreader.mathworks.com/WebX?14@896.8e9dbxh5WSs@.ef47e04

it looks like this blog software removes anything between a less than or equal sign and the next greater than sign (even if that is several lines later) from your readers&#039; posts.  just fyi.

thanks again,
-erik</description>
		<content:encoded><![CDATA[<p><a href="http://blogs.mathworks.com/loren/?p=28" rel="nofollow">http://blogs.mathworks.com/loren/?p=28</a><br />
and<br />
<a href="http://blogs.mathworks.com/loren/?p=65#12" rel="nofollow">http://blogs.mathworks.com/loren/?p=65#12</a><br />
were just what i needed, thanks!  i knew i was being dumb.</p>
<p>incidentally, the code i posted worked fine, i just thought it was ugly and knew you would know of a better way.  it does have comments that describe its specification and i think they are pretty simple, plus i posted a reference to the matlab documentation that explains the algorithm.  i did not know that pre tags were necessary to prevent the blog software from mangling code (i guess less than and greater than signs are dangerous on the web) &#8212; i merely pasted in text from my m-file editor.  anyway, the code pasted fine into that matlab forum at:<br />
<a href="http://newsreader.mathworks.com/WebX?14@896.8e9dbxh5WSs@.ef47e04" rel="nofollow">http://newsreader.mathworks.com/WebX?14@896.8e9dbxh5WSs@.ef47e04</a></p>
<p>it looks like this blog software removes anything between a less than or equal sign and the next greater than sign (even if that is several lines later) from your readers&#8217; posts.  just fyi.</p>
<p>thanks again,<br />
-erik</p>
]]></content:encoded>
	</item>
</channel>
</rss>

