How do I calculate percentage differences between initial and final values?
古いコメントを表示

For an assignment I need to give the percentage difference or change between an initial and final value. It is about a distribution of a 27 city model as in the picture. Is it possible to calculate all those differences with one command? Thanks.
回答 (2 件)
Michiel Buijsman
2015 年 2 月 26 日
編集済み: Michiel Buijsman
2015 年 2 月 26 日
0 投票
Star Strider
2015 年 2 月 26 日
編集済み: Star Strider
2015 年 2 月 26 日
It depends on how you want to define it.
This works:
pct_change = 100*(final-initial)./initial;
This is vectorised, so you can use it with vectors of ‘initial’ and ‘final’.
カテゴリ
ヘルプ センター および File Exchange で Simulink Design Optimization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!