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

 Akzeptierte Antwort

KSSV
KSSV am 4 Sep. 2020
Bearbeitet: KSSV am 4 Sep. 2020

1 Stimme

iwant = linspace(1,2,99)
Also
n = 99 ;
dx = (2-1)/(n-1) ;
x = 1:dx:2 ;

3 Kommentare

Ketan Patel
Ketan Patel am 4 Sep. 2020
thank you so much!!!
KSSV
KSSV am 4 Sep. 2020
Thanks is accepting/ voting the answer.. :)
Ketan Patel
Ketan Patel am 4 Sep. 2020
Done :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by