Array of fixed length

1 回表示 (過去 30 日間)
Emma
Emma 2020 年 12 月 9 日
コメント済み: Walter Roberson 2020 年 12 月 9 日
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
Walter Roberson 2020 年 12 月 9 日
Hint: ones(), or repmat(), or repelem() .

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by