Adding elements between 2 values

조회 수: 6 (최근 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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by