I am trying to find the simplest way to create a unit vector with arbitrary number of elements in Matlab.
for example V=[1 1 1 1 1 1 1 1 1]

 Réponse acceptée

if by "unit" vector you means vector where the elements are all 1s
len = 9;
V = ones(1,len)
V = 1×9
1 1 1 1 1 1 1 1 1

Plus de réponses (0)

Catégories

En savoir plus sur Aerospace Blockset dans Centre d'aide et File Exchange

Produits

Version

R2021b

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by