write a function called calcrmse with 2 input vectors, checks to see if the vectors are the same size. in matlab

main.m
function rmse = calcrmse(vector1, vector2)
    if length(vector1) ~= length(vector2)
        error('Input vectors must be of the same size');
    end
    
    rmse = sqrt(mean((vector1 - vector2).^2));
end
206 chars
8 lines

related categories

gistlibby LogSnag