필터 지우기
필터 지우기

Vector Difference

조회 수: 2 (최근 30일)
Mark
Mark 2011년 11월 24일
Given a vector x=[2 5 6 10 16 29].
Is there a one line command to create another vector that is the difference between the last elements (first element of x is first element of y)?
Example Output: y=[2 3 1 4 6 13]

채택된 답변

David Young
David Young 2011년 11월 24일
y = [x(1) diff(x)]
  댓글 수: 1
Mark
Mark 2011년 11월 24일
I appreciate the quick response. Excellant. Thankyou.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by