Creating a matrix which contains submatrices

11 次查看(过去 30 天)
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 ?

回答(1 个)

Akira Agata
Akira Agata 2020-4-13
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);

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by