Calculate percentage difference between two variables

9 visualizaciones (últimos 30 días)
Muzammil Ali
Muzammil Ali el 6 de Ag. de 2019
Editada: Luna el 6 de Ag. de 2019
I want to calculate percentage difference between measured and calculated variables along the time axis. Both measured and preducted variables are arrays of different size. I want to calculate the percentage error for the corresponding time.
  3 comentarios
Adam
Adam el 6 de Ag. de 2019
Or
100 * ( predicted - measured ) / measured
?
Muzammil Ali
Muzammil Ali el 6 de Ag. de 2019
Editada: Muzammil Ali el 6 de Ag. de 2019
Thank you for your answer. Yes, this is what I want but it will not work as size of the array predicted is different from size of array measured. And hence predicted(xx) is not at the same time as measured(xx).

Iniciar sesión para comentar.

Respuesta aceptada

Luna
Luna el 6 de Ag. de 2019
Editada: Luna el 6 de Ag. de 2019
You should resample one array's elements according to other array's time.
Check the below function for this:
After resampling your 2 arrays will be the same size. You can substract.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by