i need the matlab code of question (b), thanks

3. Cubic spline interpolating functions can be computed in MATLAB. Many types of boundary conditions are possible, including the clamped boundary conditions and the second boundary conditions. We will consider only the clamped boundary conditions. For the cubic spline with clamped boundary conditions, the data to be interpolated should be stored in vectors, say X (the x,s) and Y (the f()s), where Y has 2 more entries than X, the first and last entries of Y are the two clamped boundary conditions (f (ro) and f(), respectively. If S(x) denotes the cubic spline interpolant, and z is a given number, then the value of S(2) can be computed by entering spline(X, Y, z) Note that z can also be a vector of values at which you want to evaluate the spline (as in part (b) below If you want to actually determine the coefficients of the spline, you first must determine the pp (piecewise polynomial) form of the spline by entering pp spline(X, Y) Some information (which you can ignore) about the pp form of the spline is given. Then enter [b, c unmkppC pp)

3. Cubic spline interpolating functions can be computed in MATLAB. Many types of boundary conditions are possible, including the clamped’ boundary conditions and the ‘second’ boundary conditions. We will consider only the clamped boundary conditions. For the cubic spline with clamped boundary conditions, the data to be interpolated should be stored in vectors, say X (the x,’s) and Y (the f()’s), where Y has 2 more entries than X, the first and last entries of Y are the two clamped boundary conditions (f (ro) and f(), respectively. If S(x) denotes the cubic spline interpolant, and z is a given number, then the value of S(2) can be computed by entering spline(X, Y, z) Note that z can also be a vector of values at which you want to evaluate the spline (as in part (b) below If you want to actually determine the coefficients of the spline, you first must determine the pp (piecewise polynomial) form of the spline by entering pp spline(X, Y) Some information (which you can ignore) about the pp form of the spline is given. Then enter [b, c unmkppC pp)



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *