ppval evaluates your spline at all points in xx
. That produces a vector. You then try to store the vector in ddbmus(i)
, which is a scalar.
You probably want to store the full vector in rows (or columns) of a matrix. If so:
ddbmus = zeros(52, 250);
for i = 1:52
% ... existing code
ddbmus(i, :) = ppval(cs,xx);
end