How do I calculate percentage differences between initial and final values?
조회 수: 10 (최근 30일)
이전 댓글 표시

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.
댓글 수: 0
답변 (2개)
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’.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 NaNs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!