Answer:
PLEASE UP VOTE
MATLAB
%% function y = WS2_LastName_FirstInital()
clear
clc
n = 4; %number of terms-1
x = [0 3 5 8 13];
f = [0 225 383 623 993];
xx = 6; %interp point Q(6)
Q = zeros(n+1,n+1); %initialising Q with all zeros
for i=1:n+1
Q(i,i) = f(i); %Qi,i = yi
end
for j=2:n+1
for i=1:j-1
Q(i,j) = (((xx-x(j))*Q(i,j-1)) - ((xx-x(i))*Q(i+1,j)))/(x(i)-x(j))
;
end
end
y = Q(1,5);
disp(Q)

1. Given the data table with f(x) = yn for a unkown function f, determine the cubic spline interpolation that intersects with the 3 data points. No need to solve for the coefficients. Just set up the eight equations. 1.1 3.5 1.2 3.7 1.3 2.9 2. The fixed point iteration can be used to find the solution of a function f(r) = 0. To use this method, we need to first identify g(x) such that the solution of g(x) =...
Problem 4 (Analytical and Computational-20 points) Given a second-order ordinary differential equation: d2f(t) df(t) with the following initial conditions: (O) 1 and ait 0 (Analytical-10 points) Express Equation (1) in state-space form. Cleary write down the A, B, C, and D matrices. Then find the state transition matrix and determine the solution for f(t) if the input function r(t) is a unit step function. a) b) (Computational-10 points) Write a MATLAB-Simulink program to find the computational solution for f(t) in...
3. For any function f and n1 distinct nodes ro,....Tn, Lagrange interpolation factors f P R where and R is the approximation error. The following Matlab function, function a linterp_poly (X, a-zeros (1,numel(X)) for i1:numel(X) aa - poly (X([1:i-1 i+1:end])); a-a + Y(i) * aa / polyval (aa, X(i)); end end represents P(z)-Ση:0akrk as its coefficients a-lan, an-1, , al, ao (this solves Worksheet 7 Q2.) a) Write a Matlab function that uses P to approximate fd() for any positive...
Help with Numerical Methods Review (CMPS407) 1. State in your own words what is the least square method? Why we need to use this method? Write a Matlab or C/C++ to do least square fitting on the following data points: data point: (-2, 13), (-1, 5), (0, 7), (1, 12), (2, 29). 2. When can aliasing happen in the Fourier series processing? How to prevent this? 3. What’s Gibbs phenomenon? How to avoid this? Write a flow chart to implement...
Function driver and script file please
4) The polynomial f (x)-0.0074x*-0.284x3+ 3.355x2 12.183x +5 has a real root between 15 and 20. Apply the Newton-Raphson method to this function using an initial guess of xo-16.15. Explain your results. 5) Use the roots MATLAB function to find the roots of the polynomial x x-1-0. Compare your answer to the answer you derived in in question 1. 6) Write the following set of equations below in matrix form. Use MATLAB to solve...
In this exercise you will work with LU factorization of an matrix A. Theory: Any matrix A can be reduced to an echelon form by using only row replacement and row interchanging operations. Row interchanging is almost always necessary for a computer realization because it reduces the round off errors in calculations - this strategy in computer calculation is called partial pivoting, which refers to selecting for a pivot the largest by absolute value entry in a column. The MATLAB...
1) (80pts) Consider the following function f(x)--x5-4x4 + 2x3 + x2-3x + 5 Develop a simple program which will give an iterative solution to the problem f(x)=0 by Newton's algorithm. The solution should display the results on an Excel spreadsheet such as the one given below (the example below is given for a different function). Choose the programming language which suits you most, however the program should be able to read data from an Excel spreadsheet and write the successive...
2. Create a main program that calls the subroutine created on problem 1 and compare results using the following data sets: b. 1 5), (0, 8), (3,-10) С. (-10,-2), (45), (73), (12, 20) t: (copy and paste the output in the following box) Use MATLAB or Scilab to solve the following problems 1. Create a MATLAB subroutine called Lagrange.m that receives two set data points, x and y and plots the curve by interpolating the missing points (hEX-Xi-1) using Lagrange...
LU Decomposition Gauss Method EX4: Solve the same problem using the Gauss method. Example 4-6: MATLAB user-defined function for solving a system of equations using LU decomposition with Crout's method. ( Y Suggestions Use the code from the Crout's method. Discard the LUdecomp Crout module and leave the rest. Modify Gauss Pivot to store all the ratios Create the lower triangular matrix Confirm that L.U = A. Solve the problem by the LU double substitution Determine the currents ij, in,...
question 3 please
The first 5 questions refer to finding solutions to the equation exp(w) = 3.8 ln(1+x). You will need to write it in the form f(x)-0, and use various root finding methods. 1. (10 pts) Plot the curves y- exp(Vx), and y 3.8 ln(1+x) on the same graph in the range 0 x 6. Read off intervals in which there are roots of the equation exp(k)- 3.8 In(1+x) Now find the roots to 6 decimal places using the...