Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Is it possible to create a vector with a specified number of ones? eg . V=[ 1 1 1 1 0 0 0 0 0 0 0 0]
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to generate a vector with specified number of ones in it? Using for loop ,is it possible to generate it?
0 comentarios
Respuestas (1)
Azzi Abdelmalek
el 29 de Mzo. de 2016
Editada: Azzi Abdelmalek
el 29 de Mzo. de 2016
َََََA=zeros(1,12)
A(1:4)=1
Or
A=[ones(1,4) zeros(1,8)]
1 comentario
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!