Re: ? grouping data in MatLab
※ 引述《me1237guy.bbs@bbs.cs.nthu.edu.tw (Ryan)》之銘言:
> You may use "vectorization" techniques rather than the traditional for-loop.
> For exmaple, suppose your data format is defined as follows:
> data = [x(1) y(1) z(1) type; x(2) y(2) z(2) type; ...;x(NoData) y(NoData) z(NoData) type];
> ind = (data(:,4)==1); % find index of type 1 data
> data(:,ind); % it represents type 1 data
> ind = (data(:,4)==2); % find index of type 2 data
> data(:,ind); % it represents type 2 data
But what if those processes are sequential? That is, one needs to process
1st element that belongs to type-1, and then 2nd element that belongs to
type-1, and so on?
Thanks,
by Cheng Cosine
Jul/01/2k6 NC
--
┌─────◆KKCITY◆─────┐ KK免/費/撥/接 ◤
│ bbs.kkcity.com.tw │▏電話(1):449◤1999 電話(2):4058-6000
└──《From:71.77.83.46 》──┘▏帳號:kkcity 密碼:kkcity
--
討論串 (同標題文章)
Programming 近期熱門文章
PTT數位生活區 即時熱門文章