Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Reshape
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jerry  
View profile  
 More options Nov 15 2012, 3:35 pm
Newsgroups: comp.soft-sys.matlab
From: "Jerry " <jerrych...@gmail.com>
Date: Thu, 15 Nov 2012 20:35:15 +0000 (UTC)
Local: Thurs, Nov 15 2012 3:35 pm
Subject: Reshape
Hello,

A=rand (201,7152);

"A" is a matrix and I would like to reshape "A" to "B"

B=reshape (A,59898,24);

"B" is not going to be what I expected since it is getting mixed up. For example

C=A(:,1:24);
D=B(1:201,:);

isequal(C, D)

ans =

     0
How can I reshape "A" to get "C" equal with "D".

Thanks,
Jerry


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Stafford  
View profile  
 More options Nov 15 2012, 7:43 pm
Newsgroups: comp.soft-sys.matlab
From: "Roger Stafford" <ellieandrogerxy...@mindspring.com.invalid>
Date: Fri, 16 Nov 2012 00:43:15 +0000 (UTC)
Local: Thurs, Nov 15 2012 7:43 pm
Subject: Reshape

- - - - - - - - -
  To get the kind of rearrangement you have in mind takes more than a simple 'reshape'.  One has to do a little permuting first.  Do this:

 r = 298; % The number of your blocks
 [p,t] = size(A); % p = 201, t = 7152
 q = t/r; % t must be divisible by r, q = 24
 s = 0:p*q*r-1;
 B = reshape(A(1+s+p*((q-1)*floor(s/p)-(q*r-1)*floor(s/(p*r)))),p*r,q);

Roger Stafford


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »