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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by