Array of fixed length

1 view (last 30 days)
Emma
Emma on 9 Dec 2020
Commented: Walter Roberson on 9 Dec 2020
A user inputs a value n.
I want to make an array that has n values, 1/n.
If n=4, output would be
[1/4 1/4 1/4 1/4]
Not quite sure how to do this.
  1 Comment
Walter Roberson
Walter Roberson on 9 Dec 2020
Hint: ones(), or repmat(), or repelem() .

Sign in to comment.

Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!