Home > other >  RMSE between two tables in Matlab
RMSE between two tables in Matlab

Time:10-23

I have two tables x and y in Matlab that contain one column each of equal length. I just want to compute the RMSE between the two columns, but somehow I cannot do this simple operation.

rmse = sqrt(sum((x(:)-(y)(:)).^2)/1000)

It gives me an invalid array indexing error. What am I doing wrong? Thanks.

CodePudding user response:

In MATLAB you can only index variables, but not expressions. But that's exactly what you try to do with

(y)(:)

as (y) is an expression. Instead use

y(:)
  • Related