How to access the minor of a matrix.

If I have an n x n matrix, is there a way to access a smaller part of the matrix (thus yielding a smaller matrix) with arbitrary size? For instance, I have a randomly generated 32x32 matrix and I would like to access the 16x16 block in the lower right. I suppose I could simply access the entries I want but that seems inefficient, particularly as my matrix sizes increase.

댓글 수: 3

Matt J
Matt J 2013년 6월 5일
What is the difference between this:
is there a way to access a smaller part of the matrix (thus yielding a smaller matrix) with arbitrary size
and accessing the entries:
I suppose I could simply access the entries I want but that seems inefficient, particularly as my matrix sizes increase.
Jan
Jan 2013년 6월 5일
What exactly seems inefficient?
Hayashi
Hayashi 2013년 6월 5일
There isn't a difference. I can construct the minor by accessing the entries. I was wondering if I could simply specify the minor I want and MATLAB could create it.

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

 채택된 답변

Iain
Iain 2013년 6월 5일

1 개 추천

big = randn(1000,1000,4);
small = big(n:n+m,o:o+p,q:q+r);
small is an m+1 x p+1 x r+1 matrix, which was taken starting at (n,o,q) of the big one...
It works on whatever number of dimensions you need.

댓글 수: 1

Matt J
Matt J 2013년 6월 5일
편집: Matt J 2013년 6월 5일
@Hayashi
This doesn't seem different from "accessing the entries". The expression
small = big(n:n+m,o:o+p,q:q+r);
does access entries from "big".

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2013년 6월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by