Borrar filtros
Borrar filtros

how do i print this matrix?

2 visualizaciones (últimos 30 días)
Ann Lee
Ann Lee el 1 de Abr. de 2022
Respondida: Stephen23 el 1 de Abr. de 2022
hi!
i want to print this matrix..
i think there is a easy pattern in this matrix but i couldn't found..!
Is there a easy way to create this matrix?

Respuesta aceptada

KSSV
KSSV el 1 de Abr. de 2022
A = zeros(6,5) ;
A(1:3,1:3) = 1 ;
A(:,4) = [1 0 0 1 1 1]' ;
A(:,5) = [1 0 0 1 1 1]' ;
A
A = 6×5
1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1
  1 comentario
Ann Lee
Ann Lee el 1 de Abr. de 2022
thank you again!!!!!! have a good day!!

Iniciar sesión para comentar.

Más respuestas (1)

Stephen23
Stephen23 el 1 de Abr. de 2022
M = repelem([1,1;1,0;0,1],[1,2,3],[3,2])
M = 6×5
1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1

Categorías

Más información sobre Resizing and Reshaping 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