Split 132*63 by 2 or 3 for avoid complication

Hi Everyone, I have a matrix sized by 132x63. I want to split it in 2 ratio. EX: imagine my matrix is 6x4.
A= [5 7 8 6 6 4, 5 4 7 9 4 2, 9 9 7 5 3 3, 6 4 3 7 3 3]
I want to create new matrix which have columns 1st 3rd 4th 6th of A. Rows 1st and 3rd. new matrix should be 3x2. For my orginal matrixi 132*63, new matrix should be 66*32. How can I split it. Thanks a lot.
Yaman

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 2 日
編集済み: Azzi Abdelmalek 2012 年 11 月 2 日

0 投票

A= [5 7 8 6 6 4; 5 4 7 9 4 2; 9 9 7 5 3 3; 6 4 3 7 3 3];
B=A([1 3],[1 3 4 6])
for your second example, you did'nt explain how should be your index
A=rand(132,63)
idx1=1:2:131
idx2=[1 3 4 6:2:63]
B=A(idx1,idx2)
Andrei Bobrov
Andrei Bobrov 2012 年 11 月 2 日

0 投票

A = randi(125,132,63);
B = A(1:2:end,1:2:end);

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

質問済み:

2012 年 11 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by