How to store an m x n array into another m x n array?

조회 수: 1 (최근 30일)
Sarah
Sarah 2012년 10월 23일
My problem is probably simple, but I'm not sure if my approach is correct or not. This is what I have:
for A = 1:1:16
Mode = emd(PEData(:,A));
IMF{:,A} = Mode;
end
PEData is a (3078,1:16) matrix. The function emd processes the data and returns the variable Mode. Mode is also a matrix which varies for each A. So for example:
A = 16; Mode = 3078 x 10
A = 15 Mode = 3078 x 12
A = 14 Mode = 3078 x 9
etc etc
I want to store each Mode matrix in another matrix, "IMF". So:
IMF{1,16} = 3078x10 IMF{1,15} = 3078x12
etc etc
Is the above code I provided a correct way to do this? Thanks for your help!

답변 (1개)

Matt J
Matt J 2012년 10월 23일
편집: Matt J 2012년 10월 23일
Looks fine for the most part, though I would tweak it as follows,
IMF=cell(1,16); %pre-allocate
for A = 1:16 %no need for 1:1:16
Mode = emd(PEData(:,A));
IMF{A} = Mode; %no need for ':'
end

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by