Piecewise evaluation of mean absolute error an plotting

2 Ansichten (letzte 30 Tage)
Joaquim
Joaquim am 4 Aug. 2017
Kommentiert: Matt J am 4 Aug. 2017
Hello everybody,
I have two vectors, A and B. A represents the reference and B a noisy reconstruction.
I want to calculate the mean absolute error, MAE, in groups in a range of 20 units.
Then, I want to plot(A, MAE) using this piecewise evaluation.
How can I do this?
Joaquim

Antworten (1)

Matt J
Matt J am 4 Aug. 2017
Bearbeitet: Matt J am 4 Aug. 2017
Something like the following, I suppose,
MAE = conv(abs(A(:)-B(:)), ones(20,1)/20 ,'valid');
plot(MAE)
  3 Kommentare
Matt J
Matt J am 4 Aug. 2017
They should have different lengths. The number of length=20 sections of A and B is shorter than A and B.
Matt J
Matt J am 4 Aug. 2017
You could try doing conv(...,'same') instead of 'valid'.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by