Issue regarding loop to find Root mean square error in MATLAB

I have 6 different data sets from sensor and I want to find out the Root mean Square error but of the limited signal with limits means RMSE of sig_diff_lim.
I have tried to apply loop but it’s not working can anybody tell me where I am at fault.
Thanks in anticipation.
clc
drv(1)=load('a.mat');
drv(2)=load('b.mat');
drv(3)=load('c.mat');
drv(4)=load('d.mat');
drv(5)=load('e.mat');
drv(6)=load('h.mat');
for i= 1:numel(drv)
t=drv(i).T;
ref=drv(i).P;
lws=drv(i).SWA;
sig_diff(i,:) =lws(i)-ref(i);
swvel_thres=10;
vehvel=30;
SAmax=90;
sig_diff_lim(i,:)=sig_diff((lws_7(i)<SAmax)&(lws_7(i)>-SAmax)&(swav(i)<swvel_thres)&(vel(i)>vehvel));
square_error(i,:) = (sig_diff_lim(i)).^2;
mse(i,:)= mean(square_error(i));
rmse(i,:) = sqrt(mse(i));
end
rmse
mse

1 comentario

What issue are you experiencing? Is the code resulting in an error? Are the outputs not what you expect? It is hard to tell what might be going wrong without having an example MAT-file that reproduces the issue.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 24 de Jul. de 2017

Comentada:

el 27 de Jul. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by