How to construct a Row Vector
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
M Salman Rashed
le 14 Oct 2016
Commenté : M Salman Rashed
le 14 Oct 2016
I want to construct a row vector, with say, "L zeros", followed by a "1", and then again followed by "L Zeros"
What is the easiest command to do that? For example a= [ (0 0 0 ... L-1(0)) 1 (0 0 0 ... (L-1) 0)]
0 commentaires
Réponse acceptée
Andrei Bobrov
le 14 Oct 2016
Modifié(e) : Andrei Bobrov
le 14 Oct 2016
L = 5; % or L = 1000
out = [zeros(1,L),1,zeros(1,L)];
Voir également
Catégories
En savoir plus sur Operators and Elementary Operations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!