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.

Respuestas (2)

Michiel Buijsman
Michiel Buijsman el 26 de Feb. de 2015
Editada: Michiel Buijsman el 26 de Feb. de 2015
Never mind, I just found the excel file which was saved after the run. However, is there a way to do it?
Star Strider
Star Strider el 26 de Feb. de 2015
Editada: Star Strider el 26 de Feb. de 2015
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’.

Categorías

Preguntada:

el 26 de Feb. de 2015

Editada:

el 26 de Feb. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by