MATLAB Answers

0

How can we create a vector of length n

Asked by Asma Ahmed on 19 Sep 2019 at 0:56
Latest activity Commented on by Asma Ahmed on 19 Sep 2019 at 6:50
Hello,
How can we write in Matlab vector u= [1/10 ,1/10 ,..., 1/10] where u \in{R}^{200}

  0 Comments

Sign in to comment.

1 Answer

Answer by James Tursa
on 19 Sep 2019 at 1:13
Edited by James Tursa
on 19 Sep 2019 at 5:18
 Accepted Answer

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.

  2 Comments

Bruno Luong
on 19 Sep 2019 at 5:52
1/10+zeros(1,200)
1/10*ones(1,200)
Asma Ahmed on 19 Sep 2019 at 6:50
Thank you so much

Sign in to comment.