Create a vector with a user inputted increment.

6 vues (au cours des 30 derniers jours)
furcifer
furcifer le 19 Nov 2018
Commenté : madhan ravi le 19 Nov 2018
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].

Réponse acceptée

madhan ravi
madhan ravi le 19 Nov 2018
minimum=input('minimum= ')
maximum=input('maximum= ')
increment=input('increment= ')
vector=minimum:increment:maximum;
  2 commentaires
furcifer
furcifer le 19 Nov 2018
thanks ravi. I think it's about time I get some sleep, I can't remember anything.
madhan ravi
madhan ravi le 19 Nov 2018
Anytime :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by