Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Matrix data shifting problem

Subject: Matrix data shifting problem

From: Abhishek

Date: 24 Apr, 2012 02:53:07

Message: 1 of 3

Hi all,

I want to transfer data from a 23*3 matrix imfsizesub1 to a 41400*3 matrix. The 23*3 matrix is being generated repeatedly in the secondary for loop (for channel = 1:23) and the data from this has to be transferred to matrix variable. Although the imfsub1 channel has been generated properly, my code doesn't reflect changes in the variable matrix which is my result matrix. I have written a code for the same, below is my code:

tic;
variable=zeros(41400,3);
imfsizesub1=zeros(23,3);
for epoch=1:1:1800
        for channel=1:23
            
            e1=e(:,:,epoch);
  
            X=e1(:,channel);
            
            IMF=emd(X);
            
            [m,n]=size(IMF);
            
            imfsizesub1(channel,1)=m;
            imfsizesub1(channel,2)=channel;
            imfsizesub1(channel,3)=epoch;
        end
        variable((1:23*epoch),:)=imfsizesub1;
end
imfsizetime=toc;


Kindly point out bugs or errors. Thank you.

Subject: Matrix data shifting problem

From: Roger Stafford

Date: 24 Apr, 2012 16:54:09

Message: 2 of 3

"Abhishek " <abhishekagrawal.bits@gmail.com> wrote in message <jn54ij$hm1$1@newscl01ah.mathworks.com>...
> ........
> variable((1:23*epoch),:)=imfsizesub1;
> ........
- - - - - - - - -
  This is probably what you want:

 variable(23*epoch-22:23*epoch,:) = imfsizesub1;

Roger Stafford

Subject: Matrix data shifting problem

From: Abhishek

Date: 24 Apr, 2012 17:30:13

Message: 3 of 3

Thanks, problem solved! :)

"Roger Stafford" wrote in message <jn6lrg$9g6$1@newscl01ah.mathworks.com>...
> "Abhishek " <abhishekagrawal.bits@gmail.com> wrote in message <jn54ij$hm1$1@newscl01ah.mathworks.com>...
> > ........
> > variable((1:23*epoch),:)=imfsizesub1;
> > ........
> - - - - - - - - -
> This is probably what you want:
>
> variable(23*epoch-22:23*epoch,:) = imfsizesub1;
>
> Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us