How to perform these matrix calculations?

1 回表示 (過去 30 日間)
Nisar Ahmed
Nisar Ahmed 2022 年 11 月 21 日
回答済み: Steven Lord 2022 年 11 月 21 日
Q1: I have matriz z of size (101 97) and I want substract e.g., first row from second, then second from 3rd row and 3rd from 4rth row and so on... such that the new matrx will be of size (100 97). How can I do it in matlab?
Q2: I have a matrx T of size 100 97 and want make calculation as explaind in the figure below: i.e., new value column E is the value of D column plus cumsum of previous values E (as given in figure). I want to perform it on a whole matrix of size(100 97)?

回答 (1 件)

Steven Lord
Steven Lord 2022 年 11 月 21 日
See the diff and cumsum functions.


Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by