Q =
10 20 30 40 50 60 70
8 9 10 11 12 13 14
33 30 27 24 21 18 15
28 35 42 49 56 63 70
36 45 54 63 72 81 90
-1 -2 -3 -4 -5 -6 -7
64 69 74 79 84 89 94
required to find:
T=
64 79 94
28 49 70
10 40 70
I used syntax Q([7:21:49; 4:21:49; 16:6:49;])
but it doesn't work. I can only get
64 79 94
28 49 70
using Q([7:21:49; 4:21:49]) and it doesn't accept Q([7:21:49; 4:21:49; 16:6:49;])... any ideas?

댓글 수: 3

Dwyane  Wade
Dwyane Wade 2011년 8월 16일
I have a new answer : Q(1:3:7, [1;4;7]) which yields to:
10 40 70
28 49 70
64 79 94
now how do I flip this upside down? help me pls
Paulo Silva
Paulo Silva 2011년 8월 16일
The flipud function does that but you can easily avoid using it, see my answer below.
Dwyane  Wade
Dwyane Wade 2011년 8월 16일
I got it now guys!
flipud(Q(1:3:7, [1;4;7]))
Thanks for the help anyway!

댓글을 달려면 로그인하십시오.

 채택된 답변

Paulo Silva
Paulo Silva 2011년 8월 16일

0 개 추천

Q =[10 20 30 40 50 60 70
8 9 10 11 12 13 14
33 30 27 24 21 18 15
28 35 42 49 56 63 70
36 45 54 63 72 81 90
-1 -2 -3 -4 -5 -6 -7
64 69 74 79 84 89 94]
Q(7:-3:1,1:3:7)

댓글 수: 3

Dwyane  Wade
Dwyane Wade 2011년 8월 16일
Thank you sir but I've found a much efficient way of doing this :
flipud(Q(1:3:7, [1;4;7]))
I learned that from you! Thank you! :)
Paulo Silva
Paulo Silva 2011년 8월 16일
sorry but that's not efficient at all, you are using a function without needing it.
Dwyane  Wade
Dwyane Wade 2011년 8월 16일
its ok we are allowed to use it sir. thank you for the help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by