<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Reshape a matrix without using a for loop</title>
	<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/</link>
	<description>Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.</description>
	<pubDate>Sun, 22 Nov 2009 23:56:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: dhull</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1679</link>
		<dc:creator>dhull</dc:creator>
		<pubDate>Mon, 16 Nov 2009 20:44:59 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1679</guid>
		<description>@Niken,

Create the string and then display it at the end.  DISP is going to automatically put a line feed carriage return in there.

Doug</description>
		<content:encoded><![CDATA[<p>@Niken,</p>
<p>Create the string and then display it at the end.  DISP is going to automatically put a line feed carriage return in there.</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: niken</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1676</link>
		<dc:creator>niken</dc:creator>
		<pubDate>Mon, 16 Nov 2009 11:15:52 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1676</guid>
		<description>I have a problem related to loop for string

how to make

y = havehavehave......

i used 
n=1;
k='used';
while k=&#60;5
disp(k)
n=n+1;
end

the result is
have
have
have
heve


how to make the result is y=havehavehavehave ?</description>
		<content:encoded><![CDATA[<p>I have a problem related to loop for string</p>
<p>how to make</p>
<p>y = havehavehave&#8230;&#8230;</p>
<p>i used<br />
n=1;<br />
k=&#8217;used&#8217;;<br />
while k=&lt;5<br />
disp(k)<br />
n=n+1;<br />
end</p>
<p>the result is<br />
have<br />
have<br />
have<br />
heve</p>
<p>how to make the result is y=havehavehavehave ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhull</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1665</link>
		<dc:creator>dhull</dc:creator>
		<pubDate>Tue, 10 Nov 2009 21:04:59 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1665</guid>
		<description>&lt;pre class = "code"&gt;
a  = [11 1; 12 1; 23 2; 24 2]

target = 2;
[vr, vc] = find(a(:,2) == target);

newMatrix = a(vr, :)
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<pre class = "code">
a  = [11 1; 12 1; 23 2; 24 2]

target = 2;
[vr, vc] = find(a(:,2) == target);

newMatrix = a(vr, :)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carolyn</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1661</link>
		<dc:creator>Carolyn</dc:creator>
		<pubDate>Tue, 10 Nov 2009 00:30:53 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1661</guid>
		<description>Hey everyone. I am having a problem that 'kind of' relates to this. I have a mtx that is 9511x2, and I am trying to break it up according to the value in the second column, into smaller matrices for each value. for example i have 

345 2
367 2
122 2
12   2
345 3
12   3
34   3

i want to end up with a mtx
345 2
367 2
122 2
12   2

and another
345 3
12   3
34   3

etc

so that I can use the each on its own for further manipulation. I've tried to used if else statements and such to delete rows, etc. but it is slow, not working, and I keep making loops that run forever (and I'm on a mac so I'm pretty sure I don't have a break key). I know there has to be an easy way to do this, please help!</description>
		<content:encoded><![CDATA[<p>Hey everyone. I am having a problem that &#8216;kind of&#8217; relates to this. I have a mtx that is 9511&#215;2, and I am trying to break it up according to the value in the second column, into smaller matrices for each value. for example i have </p>
<p>345 2<br />
367 2<br />
122 2<br />
12   2<br />
345 3<br />
12   3<br />
34   3</p>
<p>i want to end up with a mtx<br />
345 2<br />
367 2<br />
122 2<br />
12   2</p>
<p>and another<br />
345 3<br />
12   3<br />
34   3</p>
<p>etc</p>
<p>so that I can use the each on its own for further manipulation. I&#8217;ve tried to used if else statements and such to delete rows, etc. but it is slow, not working, and I keep making loops that run forever (and I&#8217;m on a mac so I&#8217;m pretty sure I don&#8217;t have a break key). I know there has to be an easy way to do this, please help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhull</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1652</link>
		<dc:creator>dhull</dc:creator>
		<pubDate>Mon, 02 Nov 2009 16:24:00 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1652</guid>
		<description>@"Crazee"

When I am faced with a problem like this, I make a simple test case and see what happens.  Look at this:

&lt;pre class = "code"&gt;
a = [1 2; 3 4]
A(:,:,1) = a
A(:,:,2) = a+4
A(:,:,:,2) = A + 10
reshape(A,[2,8])

a =

     1     2
     3     4


A =

     1     2
     3     4


A(:,:,1) =

     1     2
     3     4


A(:,:,2) =

     5     6
     7     8


A(:,:,1,1) =

     1     2
     3     4


A(:,:,2,1) =

     5     6
     7     8


A(:,:,1,2) =

    11    12
    13    14


A(:,:,2,2) =

    15    16
    17    18


ans =

     1     2     5     6    11    12    15    16
     3     4     7     8    13    14    17    18
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@&#8221;Crazee&#8221;</p>
<p>When I am faced with a problem like this, I make a simple test case and see what happens.  Look at this:</p>
<pre class = "code">
a = [1 2; 3 4]
A(:,:,1) = a
A(:,:,2) = a+4
A(:,:,:,2) = A + 10
reshape(A,[2,8])

a =

     1     2
     3     4

A =

     1     2
     3     4

A(:,:,1) =

     1     2
     3     4

A(:,:,2) =

     5     6
     7     8

A(:,:,1,1) =

     1     2
     3     4

A(:,:,2,1) =

     5     6
     7     8

A(:,:,1,2) =

    11    12
    13    14

A(:,:,2,2) =

    15    16
    17    18

ans =

     1     2     5     6    11    12    15    16
     3     4     7     8    13    14    17    18
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: crazee</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1642</link>
		<dc:creator>crazee</dc:creator>
		<pubDate>Tue, 27 Oct 2009 20:32:16 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1642</guid>
		<description>Hi Doug,

I have a question. I have a 4-D matrix like 1000x2x2x10. I reshape it to a 2-D 1000x40 matrix using:
newmatrix = reshape(oldmatrix,1000,2*2*10)

I wanted to know how is the reshape working? Basically I wanted to know what are the 40 columns in the new matrix corresponding to the original dimensions (2x2x10) of my old matrix. Does it go like:
newmatrix(:,1) = oldmatrix(:,1,1,1)
newmatrix(:,2) = oldmatrix(:,1,1,2)
.
.
newmatrix(:,11) = oldmatrix(:,1,2,1)
.
.
newmatrix(:,21) = oldmatrix(:,2,1,1)
.
.
newmatrix(:,31) = oldmatrix(:,2,2,1)
.
.
newmatrix(:,40) = oldmatrix(:,2,2,10)


Appreciate your help. Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Doug,</p>
<p>I have a question. I have a 4-D matrix like 1000&#215;2x2&#215;10. I reshape it to a 2-D 1000&#215;40 matrix using:<br />
newmatrix = reshape(oldmatrix,1000,2*2*10)</p>
<p>I wanted to know how is the reshape working? Basically I wanted to know what are the 40 columns in the new matrix corresponding to the original dimensions (2&#215;2x10) of my old matrix. Does it go like:<br />
newmatrix(:,1) = oldmatrix(:,1,1,1)<br />
newmatrix(:,2) = oldmatrix(:,1,1,2)<br />
.<br />
.<br />
newmatrix(:,11) = oldmatrix(:,1,2,1)<br />
.<br />
.<br />
newmatrix(:,21) = oldmatrix(:,2,1,1)<br />
.<br />
.<br />
newmatrix(:,31) = oldmatrix(:,2,2,1)<br />
.<br />
.<br />
newmatrix(:,40) = oldmatrix(:,2,2,10)</p>
<p>Appreciate your help. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhull</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1610</link>
		<dc:creator>dhull</dc:creator>
		<pubDate>Wed, 14 Oct 2009 13:09:04 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1610</guid>
		<description>@asad,

M = magic(4)
M(:)'

Doug</description>
		<content:encoded><![CDATA[<p>@asad,</p>
<p>M = magic(4)<br />
M(:)&#8217;</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: asad</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1609</link>
		<dc:creator>asad</dc:creator>
		<pubDate>Wed, 14 Oct 2009 13:02:35 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1609</guid>
		<description>i am the matlab beginer.i have to convert any n*n matrix into a single row vector.plz help</description>
		<content:encoded><![CDATA[<p>i am the matlab beginer.i have to convert any n*n matrix into a single row vector.plz help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dhull</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1578</link>
		<dc:creator>dhull</dc:creator>
		<pubDate>Mon, 14 Sep 2009 15:07:06 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1578</guid>
		<description>@Faisal,

What is a "groups matrix"?

Doug</description>
		<content:encoded><![CDATA[<p>@Faisal,</p>
<p>What is a &#8220;groups matrix&#8221;?</p>
<p>Doug</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Faisal</title>
		<link>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1576</link>
		<dc:creator>Faisal</dc:creator>
		<pubDate>Sat, 12 Sep 2009 12:42:38 +0000</pubDate>
		<guid>http://blogs.mathworks.com/videos/2009/03/13/reshape-a-matrix-without-using-a-for-loop/#comment-1576</guid>
		<description>dear all

i am a beginner in matlab, i have some problem. i have matrix with 500x500 dimension, i want to partition in each have 20x20 dimension so there is have 25 groups matrix. what the code looping in matlab. thx</description>
		<content:encoded><![CDATA[<p>dear all</p>
<p>i am a beginner in matlab, i have some problem. i have matrix with 500&#215;500 dimension, i want to partition in each have 20&#215;20 dimension so there is have 25 groups matrix. what the code looping in matlab. thx</p>
]]></content:encoded>
	</item>
</channel>
</rss>
