block diagonal matrix in the opposite diagonal
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Romio
 el 18 de Sept. de 2022
  
    
    
    
    
    Comentada: Romio
 el 18 de Sept. de 2022
            Is there any function/way to construct a matrix with block matrcies in the opposite diagonal. I know of blkdiag( ) but it gives a matrix with blocks in the main diagonal
0 comentarios
Respuesta aceptada
  Paul
      
      
 el 18 de Sept. de 2022
        Here's one option
a = rand(2);
b = rand(2,3);
A = blkdiag(a,b)
D = oppblkdiag(a,b)
function D = oppblkdiag(varargin)
c = cellfun(@(x) fliplr(x),varargin,'UniformOutput',false);
D = fliplr(blkdiag(c{:}));
end
2 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Operating on Diagonal Matrices 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!


