MATLAB Answers

How can we create a vector of length n

283 views (last 30 days)
Omar B.
Omar B. on 19 Sep 2019
Commented: Omar B. on 19 Sep 2019
How can we write in Matlab vector u= [1/10 ,1/10 ,..., 1/10] where u \in{R}^{200}


Sign in to comment.

Accepted Answer

James Tursa
James Tursa on 19 Sep 2019
Edited: James Tursa on 19 Sep 2019
There are many ways of doing this. E.g., use the ones( ) function and divide by 10. Or use the zeros( ) function and add 1/10. Or use the repelem( ) function. Etc.


Bruno Luong
Bruno Luong on 19 Sep 2019

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by