Creating a matrix which contains submatrices

4 visualizaciones (últimos 30 días)
David Costanza
David Costanza el 13 de Abr. de 2020
Respondida: Akira Agata el 13 de Abr. de 2020
So i want to create 2nX2n matrix that asks a number from user which called n.Also this matrix has 4 of n x n submatrices that element of submatrices bottom left corner consist zeros ?

Respuestas (1)

Akira Agata
Akira Agata el 13 de Abr. de 2020
Assuming the submatrix is n-by-n Identity matrix, the solution would be like this:
n = input('Please enter n: ');
subMat = eye(n);
M = repmat(subMat,2,2);

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by