Reputation: 87
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.
Upvotes: 0
Views: 126
Reputation: 11628
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(:)
Upvotes: 2