插值“拟合”并不是真正的拟合......它只是将您的点与线段连接起来,[或其他一些提高曲线平滑度的形状*]。无论将它们连接到什么形状,它们总是会直接穿过你的离散点,这意味着“完美”的契合。
让我重新表述这个问题:您在从模型生成的时间点 tm_k 处有一组离散点 model_k。你在不同的时间点 td_k 有另一组离散点 data_k,你想比较它们。正确的?
然后,您需要做的就是在与测量数据相同的时间点对模型进行重新采样,然后您可以对它们进行比较。对于每个数据运行:
% data is a 1xN column vector of your measured data points
% td is a 1xN column vector of the time points corresponding to d
% model is a 1xM column vector of the model points
% tm is the 1xM time vector for model
model_on_data_time_points = interp1(tm, model, td);
% Here is an example of computing with this resampled vector
difference_vector = data - model_on_data_time_points;
mse = sum(difference_vector.^2) / length(difference_vector); % mean squared error
(*) 编辑:修复“线段”语言以响应评论