Hi guys, can you help me understanding what does the question ask for? Suppose C is the matrix:
1 2 3
4 5 6
7 8 9
10 11 12
Create a matrix C2 that is the upper left 2 × 2 submatrix of C.

 채택된 답변

Joseph Cheng
Joseph Cheng 2015년 2월 26일
편집: Joseph Cheng 2015년 2월 26일

1 개 추천

what submatrix means is a subset formed by taking a block of size mxn (in your example 2x2) from the original matrix. so the 2x2 submatrix of C that is the upper left means it would be the upper left corner 2x2 [1 2;4 5].
So the question is probably asking you to define a new submatrix C2 by the means of array indexing (is that the right word?) instead of hard coding it in. you can read up on it here http://www.mathworks.com/help/matlab/math/matrix-indexing.html. So eventually it would look like:
C2=C(_somethinghere_).

댓글 수: 4

AnnaMaria Accardo
AnnaMaria Accardo 2015년 2월 26일
So I should create a new matrix where the upper left is based on C? And the rest of the matrix? How much bigger should C2 be?
Image Analyst
Image Analyst 2015년 2월 26일
C2 will not be bigger. It's the upper left 2x2 of a 4 x 3 matrix, so it's smaller, not bigger. The "rest" of the C matrix is ignored - it's not extracted and put into C2.
AnnaMaria Accardo
AnnaMaria Accardo 2015년 2월 26일
aaaaah perfect. Thanks Joseph. Easy points for you ;)
Joseph Cheng
Joseph Cheng 2015년 2월 26일
Anytime, trying to get back into this after a few month hideous.

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

추가 답변 (0개)

카테고리

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

질문:

2015년 2월 26일

댓글:

2015년 2월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by