How can I subtract second entity from the first in an array or a matrix?

3 ビュー (過去 30 日間)
M Yasir Muneeb
M Yasir Muneeb 2017 年 3 月 12 日
コメント済み: Jan 2017 年 3 月 12 日
For example,
N=[0 7330 15100 23100 30400 34400 38400 41300 44800 46200 47300 47500 46100 44800 42600 36400]
I want another array or matrix in which first element is subtracted from the second? Such as
N1=[7330-0 15100-7330 ..... ]
Last digit does not need to be subtracted since it's not lagging any element.
  2 件のコメント
Jan
Jan 2017 年 3 月 12 日
@per: diff(N) solves the problem, so please post it as an answer.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by