MATLAB: How can we create a vector of length n

homeworkvector

Hello,
How can we write in Matlab vector u= [1/10 ,1/10 ,…, 1/10] where u \in{R}^{200}

Best 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.