RMSE | Invalid Characters

1 visualización (últimos 30 días)
bondpen
bondpen el 7 de Mayo de 2018
Comentada: bondpen el 7 de Mayo de 2018
Hi
I am not sure, why it tell me the below has invalid characters.
function r = rmse(data,k)
r = sqrt(sum((data(:)-k(:)).^2)/numel(data))
end
  1 comentario
KSSV
KSSV el 7 de Mayo de 2018
What input you tried?

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 7 de Mayo de 2018
Although you cannot see it, after the final bracket on the second line, and before the linefeed for that line, there is a character which in hex is 'feff', which is http://www.fileformat.info/info/unicode/char/FEFF/index.htm "Zero width no-break space"
It also happens to be the byte pair that would be used for UTF16 to indicate "Big Endian" byte order mark (BOM). But Zero Width No-Break Space is probably what happened to you rather than BOM.
  1 comentario
bondpen
bondpen el 7 de Mayo de 2018
Yea, rewritting the code on new script fixes the issue.

Iniciar sesión para comentar.

Más respuestas (1)

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy el 7 de Mayo de 2018
Editada: Walter Roberson el 7 de Mayo de 2018
function r = RMSE(data,k)
Error=(data-k);
Squared_Error=Error.^2 ;
MSE=mean(Squared_Error);
r = sqrt(MSE);
end

Categorías

Más información sobre Matrices and Arrays 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