element to element sum

26 ビュー (過去 30 日間)
milad farshbaf
milad farshbaf 2018 年 12 月 18 日
コメント済み: milad farshbaf 2018 年 12 月 18 日
hi
i have X = [1 5 7 6 9 2 3 1 4 8 6 5]; and i want to do [1+5 5+7 7+6 6+9 ...] how can i do that?
thanks

採用された回答

Matt J
Matt J 2018 年 12 月 18 日
X(1:end-1)+X(2:end)
  1 件のコメント
milad farshbaf
milad farshbaf 2018 年 12 月 18 日
thanks for your answer

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

その他の回答 (1 件)

Matt J
Matt J 2018 年 12 月 18 日
編集済み: Matt J 2018 年 12 月 18 日
conv(X,[1,1],'valid')

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by