Adding elements between 2 values

7 visualizaciones (últimos 30 días)
Ketan Patel
Ketan Patel el 4 de Sept. de 2020
Comentada: Ketan Patel el 4 de Sept. de 2020
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

Respuesta aceptada

KSSV
KSSV el 4 de Sept. de 2020
Editada: KSSV el 4 de Sept. de 2020
iwant = linspace(1,2,99)
Also
n = 99 ;
dx = (2-1)/(n-1) ;
x = 1:dx:2 ;
  3 comentarios
KSSV
KSSV el 4 de Sept. de 2020
Thanks is accepting/ voting the answer.. :)
Ketan Patel
Ketan Patel el 4 de Sept. de 2020
Done :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by