フィルターのクリア

selecting desired values

1 回表示 (過去 30 日間)
FIR
FIR 2011 年 11 月 1 日
i gave some data
column1 column2
1,1 3,4
1,2
1,3
;
;
;
1,100 3,100
2,1
;
;
;
2,100 4,100
I want to select 15 values from each 100 ,the values in column should not change,,
(i.e) 1,1..1,15...2,1...2,15...3,1...3,15...4,1..4,15
can u tell how to process

採用された回答

Andrei Bobrov
Andrei Bobrov 2011 年 11 月 1 日
[j1,i1] = ndgrid(1:100,1:4);
ind = [i1(:) j1(:)];
somedata = ind(randperm(numel(i1)),:);
idx = bsxfun(@plus,(1:15)',0:100:numel(i1)-1);
out = somedata(idx,:);

その他の回答 (1 件)

Lulu
Lulu 2011 年 11 月 1 日
Do you want to select values based on indices? If so, then here is an example: ind = [1; 2; 5; 15]; col1 = array(ind,1); col2 = array(ind,2);
  1 件のコメント
FIR
FIR 2011 年 11 月 1 日
not on indices first 15 from 100 without changing value in columns

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by