Borrar filtros
Borrar filtros

How make this matrix using for loop?

1 visualización (últimos 30 días)
Jeong_evolution
Jeong_evolution el 20 de Sept. de 2017
Comentada: Jeong_evolution el 20 de Sept. de 2017
-1 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0
-1 -1 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0
-1 -1 -1 0 0 0 0 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0 0 0 0 0 0
-1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0
1 1 1 1 0 0 0 0 0 0 0 0 0 0
-1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0
1 1 1 1 1 0 0 0 0 0 0 0 0 0

Respuesta aceptada

Stephen23
Stephen23 el 20 de Sept. de 2017
Why use a loop?
>> M = zeros(10,14);
>> M(1:2:end,1:5) = -tril(ones(5));
>> M(2:2:end,1:5) = +tril(ones(5));
  1 comentario
Jeong_evolution
Jeong_evolution el 20 de Sept. de 2017
excellent. thanks..
I think just use for loop...

Iniciar sesión para comentar.

Más respuestas (0)

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!