Question: PLEASE FILL OUT GIVEN CODE AND USE THE SAME VARIABLES function Sx = myspline(xs,ys,Ms,x) n = length(xs)-1; % number of nodes Sx = zeros(size(x)); %%%
PLEASE FILL OUT GIVEN CODE AND USE THE SAME VARIABLES

function Sx = myspline(xs,ys,Ms,x)
n = length(xs)-1; % number of nodes
Sx = zeros(size(x));
%%% YOUR CODE GOES HERE
end
Code to call function:
n = 4;
xs = linspace(0,2,n+1);
ys = [0,1,2,-1,1];
Ms = [0,25,-25,25,0];
x = linspace(0,2,1000);
Sx = myspline(xs,ys,Ms,x);
figure;
plot(xs,ys,'o',x,Sx,'b');
IV. (cubic spline evaluation) Recall that given n +1 nodes a = x0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
