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
2012년 11월 2일
편집: Azzi Abdelmalek
2012년 11월 2일
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
2012년 11월 2일
A = randi(125,132,63);
B = A(1:2:end,1:2:end);
카테고리
도움말 센터 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!