Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
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]
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to generate a vector with specified number of ones in it? Using for loop ,is it possible to generate it?
0 Commenti
Risposte (1)
Azzi Abdelmalek
il 29 Mar 2016
Modificato: Azzi Abdelmalek
il 29 Mar 2016
َََََA=zeros(1,12)
A(1:4)=1
Or
A=[ones(1,4) zeros(1,8)]
1 Commento
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!