Simplest way to create a unit vector in Matlab?
56 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mehdi
am 18 Sep. 2022
Beantwortet: Bruno Luong
am 18 Sep. 2022
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]
0 Kommentare
Akzeptierte Antwort
Bruno Luong
am 18 Sep. 2022
if by "unit" vector you means vector where the elements are all 1s
len = 9;
V = ones(1,len)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!