How do I calculate mean absolute error?
Mostrar comentarios más antiguos
x_T = 0.3; y_T = 0.3;
A_T = 38:0.1:45;
for i_A = 1:length(A_T)
for i_file = meas
error_1(i_file,:) = sqrt((x_T_est1(i_file,:) - x_T).^2 + (y_T_est1(i_file,:) - y_T).^2);
end
end
Hello everyone. I am sharing part of my code. I am also attaching the necessary files.
What I want to do is adapt this formula. The number n is the size of the matrix x_T_est1 an y_T_est1. So 28x5=140. n = 140.

I want to calculate MAE for all numbers in matrix x_T_est1. But I want to save it in a matrix of length i_A.
In summary, subtract the x_T and y_T values for all the elements in the x_T_est1 matrix, take the square root, and add the value for all the elements. Then divide by 140. This result is a number. For example, let the result be the number A. Let it record this number A as the length of the matrix A_T. So the result vector and the vector A_T will be the same size. Result matris = A, A, A...(1x71). Vector A_T is a vector of length 1x71.
You can change the code however you want.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Sparse Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!