Adding elements between 2 values

9 ビュー (過去 30 日間)
Ketan Patel
Ketan Patel 2020 年 9 月 4 日
コメント済み: Ketan Patel 2020 年 9 月 4 日
Hello MATLAB community,
Is there a way to add elements between 2 values, lets say 1 and 2, of our own choice? For example, how can I create a vector that starts from 1, ends at 2 and has 99 other elements of equal increaments between 1 and 2?
Thank you

採用された回答

KSSV
KSSV 2020 年 9 月 4 日
編集済み: KSSV 2020 年 9 月 4 日
iwant = linspace(1,2,99)
Also
n = 99 ;
dx = (2-1)/(n-1) ;
x = 1:dx:2 ;
  3 件のコメント
KSSV
KSSV 2020 年 9 月 4 日
Thanks is accepting/ voting the answer.. :)
Ketan Patel
Ketan Patel 2020 年 9 月 4 日
Done :)

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by