How do you calculate percentage change between sequential elements in array?

12 ビュー (過去 30 日間)
txvmi07
txvmi07 2014 年 6 月 20 日
コメント済み: txvmi07 2014 年 6 月 20 日
I have a 14400x11 array of values from the output of a hyperbolic function and want to calculate the sequential percentage change from, for example, the first element in the first row and column a(i,j) to the second element in the second row and first column a(i+1,j). How can I do this?

採用された回答

A Jenkins
A Jenkins 2014 年 6 月 20 日
X=rand(3,4)
percent_change=diff(X)./X(1:end-1,:)

その他の回答 (1 件)

dpb
dpb 2014 年 6 月 20 日
pct=100*diff(a(:,1))./a(1:end-1,1);

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by