Question
Please solve it in MATLAB

6) Interpolation and plot: y=x*; x=0:5; a) Interpolate: x1= 1.5; x2=2.5; x3=3.5 b) Plot x and y and label axis. 7)- A= [1,2;3
0 0
Add a comment Improve this question Transcribed image text
Answer #1

%----ques(6)-------------------------------------------------------------
x=(0:5)';
y=x.^3;
xi=[1.5 2.5 3.5]';
yi=interp1q(x,y,xi);
hold on
plot(x,y,'-r',xi,yi,'o');
xlabel('X-axis');
ylabel('Y-axis');
%--------ques(7)---------------------------------------------------
A=[1,2;3,4];
B=[5,6;7,8];
A_plus_B = A+B;
A_minus_B = A-B;
A_MULT_B =A*B;
A_BY_B = A/B;
A_INVERSE = A^-1;
B_INVERSE = B^-1;
A_DOT_B = A.*B;
A_DOT_BY_B = A./B;
%--------ques(8)-------------------------------------------------------
syms X;
Y=X^4 - 2*X^2 + 3*X - 4;
integ=int(Y);%part(a)
sol=roots([1 0 -2 3 -4]); % [1 0 -2 3 -4] are coeff of equation
Int=int(Y,-5,5); %part(c)

Add a comment
Know the answer?
Add Answer to:
Please solve it in MATLAB 6) Interpolation and plot: y=x*; x=0:5; a) Interpolate: x1= 1.5; x2=2.5;...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • solve these questions by Matlab 10 9:17 X ull ** - STC Report Lab - للقراءة...

    solve these questions by Matlab 10 9:17 X ull ** - STC Report Lab - للقراءة فقط (1) 28 Hoď → 7 سجل دخولك لتحرير الملف وحفظ التغييرات ا... Problems Problem 1: The following polynomials are given: Py(x) = x + 2x4 - 3x + 7x2 - 8x + 7 Polx) = x + 3x - 5x2 + 9x + 11 P3(x) = x - 2x - 3x +9 P4(x)=x2-5x + 13 Ps(x) = x + 5 Use MATLAB functions...

  • In MATLAB Use symbolic math to solve and plot Laplace Problem 3.5. Problem 3.5 x1(t) 16e2t cos4t u(t x2(t) 20te2t sin4t...

    In MATLAB Use symbolic math to solve and plot Laplace Problem 3.5. Problem 3.5 x1(t) 16e2t cos4t u(t x2(t) 20te2t sin4t u(t) x3(t) 10e 3t ut-4) a. b. C. In MATLAB Use symbolic math to solve and plot Laplace Problem 3.5. Problem 3.5 x1(t) 16e2t cos4t u(t x2(t) 20te2t sin4t u(t) x3(t) 10e 3t ut-4) a. b. C.

  • In MATLAB please Consider the nonlinear function: y = f(x) = x3 cos x a. Plot...

    In MATLAB please Consider the nonlinear function: y = f(x) = x3 cos x a. Plot y as a function of x as x is varied between -67 and 67. In this plot mark all the locations of x where y = 0. Make sure to get all the roots in this range. You may need to zoom in to some areas of the plot. These locations are some of the roots of the above equation. b. Use the fzero...

  • Problem 1 Use the trapezoidal rule technique to approximate the following integrals: a) 「(x2+1)d...

    help wanted?? thank you explain correctly Problem 1 Use the trapezoidal rule technique to approximate the following integrals: a) 「(x2+1)dr(Note: use 0.5 increments forx) b) sina d INote: use a MATLAB function to subdivide the interval into eight equal parts) c e dx (Note: use 0.25 increments for x Problem 2 Use the Simpson's rule to evaluate the following integrals aDdr Problem 3: Given the polynomial: x3-6x2 + 30-0, Use MATLAB to find all roots of this polynomial. Use MATLAB's...

  • Matlab help 1) Given the functions x1()= tu()-tuft-1) and X2(t)=10e-5,11(), do the following: 1. Plotx,(t) and x2(0) using MATLAB 2. Use MATLAB to find and plot x(0=x:@*.x2(t), where * denotes co...

    Matlab help 1) Given the functions x1()= tu()-tuft-1) and X2(t)=10e-5,11(), do the following: 1. Plotx,(t) and x2(0) using MATLAB 2. Use MATLAB to find and plot x(0=x:@*.x2(t), where * denotes convolution. 3. Find x(t)=x;()*X2(1) by hand using Laplace transforms. 4. Plot the result of part 3 in MATLAB and compare it to that found in part 2. 2) Given the transfer function shown below, do the following: 1. Find the system's impulse response and plot it using MATLAB 2. Repeat...

  • 11. Let Z = (X1,X2, X3)T be a portfolio of three assets. E(X) 0.50. E(X2-1.5. E(X3) = 2.5, VAR(X)...

    11. Let Z = (X1,X2, X3)T be a portfolio of three assets. E(X) 0.50. E(X2-1.5. E(X3) = 2.5, VAR(X)-2, VAR(X2)-3, Var(Xs)-5·PX1.x2-0.6 and X1 and X2 are idependent of X3 (a) Find E(0.3xi +0.3X2 +0.4X3) and Var(0.3X1 +0.3X2 +0.4Xs) (b) Find P[0.3X1 +0.3x2 + 0.4X3 <2). Since z-table isn't provided, just write down the (c) Find the covariance between a portfolio that allocates 1/3 to each of the three assets and a portfolio that allocates 1/2 to each of the first...

  • Please answer this MATLAB questions when able. Thanks. 4. Laboratory Problem Description In this laboratory you...

    Please answer this MATLAB questions when able. Thanks. 4. Laboratory Problem Description In this laboratory you are required to Find the solution of the following systems of linear equation: 1) xl + x2 + x3 3 4x1 - x2 x3-2 x1 2x2 x3-2 2) 2 -1 3 A 1 3 -2. B-2 Given the following system 4x1+3x2+7x3- 3 3x1+2x2+1x3 1 2x1+3x2+4x3- 2 Using MATLAB commands solve the following system using Gaussian elimination with partial pivoting. Find P, L, and U...

  • 3) Let (x, y), (X2, y2), and (X3. Y3) be three points in R2 with X1...

    3) Let (x, y), (X2, y2), and (X3. Y3) be three points in R2 with X1 < x2 < X3. Suppose that y = ax + by + c is a parabola passing through the three points (x1, yı), (x2, y), and (x3, Y3). We have that a, b, and c must satisfy i = ax + bx + C V2 = ax + bx2 + c y3 = ax} + bx3 + c Let D = x X2 1....

  • 1a): Find the roots of the following polynomial equations using matlab: f(x) = x^5 − 9x^4...

    1a): Find the roots of the following polynomial equations using matlab: f(x) = x^5 − 9x^4 + 31x^3 − 51x^2 + 40x − 12 f(x) = x^5 − 11x^4 + 47x^3 − 97x^2 + 96x − 36 b): Find the coefficients of two polynomial equations in matlab given the following sets of roots: r1 = [ 100 25 50 5 10 ]    r2 = [ 11 22 33 0 55 ] c): Create a figure with four subplots, each showing...

  • Matlab Matlab Matlab Matlab, Please solve this problem Problem 4 : Runge's phenomenon For this proble,...

    Matlab Matlab Matlab Matlab, Please solve this problem Problem 4 : Runge's phenomenon For this proble, you wil interpolate the function h(x) = tanh(10x) in I [a, b, through n datapoints (xi, hx with equidistant nodes for several values of n, and observe the behavior of the interpolating polynomial as n increases. You should use the pair of functions polyfit and polyval In your prob40: (a) Interpolate the function tanh(10x) in [-1,1] using a uniform grid of n nodes, where...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT