Borrar filtros
Borrar filtros

How to access the minor of a matrix.

8 visualizaciones (últimos 30 días)
Hayashi
Hayashi el 5 de Jun. de 2013
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 comentarios
Jan
Jan el 5 de Jun. de 2013
What exactly seems inefficient?
Hayashi
Hayashi el 5 de Jun. de 2013
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.

Iniciar sesión para comentar.

Respuesta aceptada

Iain
Iain el 5 de Jun. de 2013
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 comentario
Matt J
Matt J el 5 de Jun. de 2013
Editada: Matt J el 5 de Jun. de 2013
@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".

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by