<?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 video: Sorting matrices</title>
	<atom:link href="http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/</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: Doug</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13415</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Mon, 01 Feb 2010 16:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13415</guid>
		<description>From the convhull doc

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/convhull.html

&lt;pre class=&quot;code&quot;&gt;
xx = -1:.05:1; yy = abs(sqrt(xx));
[x,y] = pol2cart(xx,yy);
k = convhull(x,y);
plot(x(k),y(k),&#039;r-&#039;,x,y,&#039;b+&#039;)
&lt;/pre&gt;

This should get you where you are going.</description>
		<content:encoded><![CDATA[<p>From the convhull doc</p>
<p><a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/convhull.html" rel="nofollow">http://www.mathworks.com/access/helpdesk/help/techdoc/ref/convhull.html</a></p>
<pre class="code">
xx = -1:.05:1; yy = abs(sqrt(xx));
[x,y] = pol2cart(xx,yy);
k = convhull(x,y);
plot(x(k),y(k),'r-',x,y,'b+')
</pre>
<p>This should get you where you are going.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fred</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13412</link>
		<dc:creator>Fred</dc:creator>
		<pubDate>Fri, 29 Jan 2010 05:18:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13412</guid>
		<description>Doug,
I have a set of coordinates for the perimeter of an object in random order. I want to plot these using the statement
&lt;pre&gt;
plot(X, Y, &#039;-&#039;);
&lt;/pre&gt;
so that I get a continuous line plot of the object perimeter. This requires getting the x coordinates representing the top half of the object in increasing order, but the x coordinates for the bottom half of the object in decreasing order.

I have tried to get the coordinates sorted using dummy columns in a matrix using code such as below and using sortrows:
&lt;pre&gt;
coords = [X Y X&gt;mean(X) Y&lt;mean(Y)];
coords = sortrows(coords, [4 1 3 2]);
plot(coords(:,1), coords(:,2), &#039;-r&#039;);
&lt;/pre&gt;
This doesn&#039;t quite work and I get a horizontal line across the middle of my object. I feel I am close using this approach, but I just can&#039;t get it. Any suggestions?
Thanks.
Fred</description>
		<content:encoded><![CDATA[<p>Doug,<br />
I have a set of coordinates for the perimeter of an object in random order. I want to plot these using the statement</p>
<pre>
plot(X, Y, '-');
</pre>
<p>so that I get a continuous line plot of the object perimeter. This requires getting the x coordinates representing the top half of the object in increasing order, but the x coordinates for the bottom half of the object in decreasing order.</p>
<p>I have tried to get the coordinates sorted using dummy columns in a matrix using code such as below and using sortrows:</p>
<pre>
coords = [X Y X&gt;mean(X) Y&lt;mean(Y)];
coords = sortrows(coords, [4 1 3 2]);
plot(coords(:,1), coords(:,2), '-r');
</pre>
<p>This doesn&#8217;t quite work and I get a horizontal line across the middle of my object. I feel I am close using this approach, but I just can&#8217;t get it. Any suggestions?<br />
Thanks.<br />
Fred</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13202</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Thu, 16 Jul 2009 14:58:08 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13202</guid>
		<description>@Mark

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/sort.html

Use sort with the second output argument.  That gives the absolute index, but you can use IND2SUB to get back to row and column.

-Doug</description>
		<content:encoded><![CDATA[<p>@Mark</p>
<p><a href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/sort.html" rel="nofollow">http://www.mathworks.com/access/helpdesk/help/techdoc/ref/sort.html</a></p>
<p>Use sort with the second output argument.  That gives the absolute index, but you can use IND2SUB to get back to row and column.</p>
<p>-Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13199</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 15 Jul 2009 23:22:45 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13199</guid>
		<description>Hello,

I need to sort the pixel intensity values of an image in descending order, but then also be able to keep track of each intensities original coordinate in the image. I assume I will need to create an Nx3 matrix where N is the total number of pixels and the 3 column values are: 1. the pixel intensity, 2. the original col, and 3. the row coordinate.

Could you help me to get started doing this?

Thanks,
Mark</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I need to sort the pixel intensity values of an image in descending order, but then also be able to keep track of each intensities original coordinate in the image. I assume I will need to create an Nx3 matrix where N is the total number of pixels and the 3 column values are: 1. the pixel intensity, 2. the original col, and 3. the row coordinate.</p>
<p>Could you help me to get started doing this?</p>
<p>Thanks,<br />
Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13134</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Wed, 22 Apr 2009 12:49:07 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13134</guid>
		<description>Renato,

What you need to do is use the transpose operator (&#039;) to transpose the rows to columns.  Then you can use sort rows and transpose right back.

Doug</description>
		<content:encoded><![CDATA[<p>Renato,</p>
<p>What you need to do is use the transpose operator (&#8216;) to transpose the rows to columns.  Then you can use sort rows and transpose right back.</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Renato</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13133</link>
		<dc:creator>Renato</dc:creator>
		<pubDate>Tue, 21 Apr 2009 19:34:34 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-13133</guid>
		<description>Hi, is there any function that does the same as sortrows but for columns?

Thx for your time!</description>
		<content:encoded><![CDATA[<p>Hi, is there any function that does the same as sortrows but for columns?</p>
<p>Thx for your time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-12875</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Tue, 23 Sep 2008 13:46:34 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-12875</guid>
		<description>Sanchay,

You need to show all the relevant code to get help.

Doug</description>
		<content:encoded><![CDATA[<p>Sanchay,</p>
<p>You need to show all the relevant code to get help.</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sanchay Subhedar</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-12873</link>
		<dc:creator>Sanchay Subhedar</dc:creator>
		<pubDate>Tue, 23 Sep 2008 03:51:08 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-12873</guid>
		<description>I am getting this error on using simple sort function on the same magic square as your.

??? Index exceeds matrix dimensions.

How can I &quot;sort&quot; this problem ;-)</description>
		<content:encoded><![CDATA[<p>I am getting this error on using simple sort function on the same magic square as your.</p>
<p>??? Index exceeds matrix dimensions.</p>
<p>How can I &#8220;sort&#8221; this problem ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-12006</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Thu, 03 Jul 2008 13:00:22 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-12006</guid>
		<description>Mayank,

Please watch the video again.  You will see Sortrows at the end.  This is the function you are looking for.

Doug</description>
		<content:encoded><![CDATA[<p>Mayank,</p>
<p>Please watch the video again.  You will see Sortrows at the end.  This is the function you are looking for.</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mayank</title>
		<link>http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-11999</link>
		<dc:creator>mayank</dc:creator>
		<pubDate>Thu, 03 Jul 2008 02:51:12 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/pick/2007/09/11/matlab-basics-video-sorting-matrices/#comment-11999</guid>
		<description>Hi,I want to sort the coordiantes.How to do this?
Eg- 1  0
    3  2
    21 0
    4  4
    2  3
    5  4
so that the sorted coordinates come out to be:
   1  0
   21 0
   3  2
   2  3
   4  4
   5  4</description>
		<content:encoded><![CDATA[<p>Hi,I want to sort the coordiantes.How to do this?<br />
Eg- 1  0<br />
    3  2<br />
    21 0<br />
    4  4<br />
    2  3<br />
    5  4<br />
so that the sorted coordinates come out to be:<br />
   1  0<br />
   21 0<br />
   3  2<br />
   2  3<br />
   4  4<br />
   5  4</p>
]]></content:encoded>
	</item>
</channel>
</rss>

