Logical Manipulation of Vector
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I require a logical vector with 'a' number of rows =1 and followed by 'b' rows =0. How can I create this without if statements?
I know a and b.
3 Commenti
Risposta accettata
Più risposte (2)
Walter Roberson
il 5 Set 2011
Something like,
kron([true;false],[a;b])
Unfortunately I cannot reach my server today to test this.
2 Commenti
Oleg Komarov
il 5 Set 2011
It could have been the most elegant, although with some overhead but the result is:
ans =
10
15
0
0
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!