inverse of a subset of a matrix
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
zakaria azdad
el 22 de Jul. de 2019
Comentada: zakaria azdad
el 25 de Jul. de 2019
Hi everyone,
I have a matrix that has an n by p dimension and I would like to grab all the 3x3 submatrices and inverse them. also by the end of the operation, I would like to put them back as n by p matrix.
As an exemple 3x28 matrix.
Hope to hear from you.
0 comentarios
Respuesta aceptada
Sahithi Kanumarlapudi
el 25 de Jul. de 2019
As 28 is not a multiple of 3 I am assuming that you are looking to invert 9 3x3 sub matrices I.e., till row 27
The following code can be used to obtain your required functionality where A is the matrix to be inverted
matLength = length(A);
r = rem(matLength,3);
mLength = matLength-r;
for i =1:3:mLength
x = A([i:i+2],:);
a = inv(x);
A([i:i+2],:) = a;
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Environment and Clutter 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!