Create a vector with a user inputted increment.

7 ビュー (過去 30 日間)
furcifer
furcifer 2018 年 11 月 19 日
コメント済み: madhan ravi 2018 年 11 月 19 日
Is there an operator like linspace that creates a vector based on a chosen increment? I have to create an array based on 3 inputs, min,max and increment. Say 0,10,3 - I need [0,3,6,9] and for 10,100,37 I need [10,47,84].

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 19 日
minimum=input('minimum= ')
maximum=input('maximum= ')
increment=input('increment= ')
vector=minimum:increment:maximum;
  2 件のコメント
furcifer
furcifer 2018 年 11 月 19 日
thanks ravi. I think it's about time I get some sleep, I can't remember anything.
madhan ravi
madhan ravi 2018 年 11 月 19 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by