看板Programming
标 题Re: ? grouping data in MatLab
发信站KKCITY (Sat Jul 1 17:17:44 2006)
转信站ptt!ctu-reader!ctu-gate!news.nctu!news.ntu!news.au!zoonews.ee.ntu!news
※ 引述《[email protected] (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
--