Array of fixed length
显示 更早的评论
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 个评论
Walter Roberson
2020-12-9
Hint: ones(), or repmat(), or repelem() .
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!