Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is the MATLAB solution below for the question above. I need to change the c

ID: 3755551 • Letter: H

Question

Here is the MATLAB solution below for the question above. I need to change the code below to something else, but I need the solutions to match each other. (Also try not to copy answer posted on chegg already)

clc; clear all; close all; % reset matlab w

t = linspace(-0.75, 0.25, 7)';
b = [0;-.1;.5;1;.8;.5;0;0];


A1 = fliplr(vander(t(1:4)));
B1 = A1(1:3,:);

A2 = fliplr(vander(t(4:7)));
B2 = A2(2:4,:);

C1 = [0 1 2*t(4) 3*t(4)^2];

A = [B1 zeros(3,4);zeros(3,4) B2;A1(4,:) -A1(4,:);C1 -C1];

x = A


t_p = linspace(t(1),t(4), 50)';
t_q = linspace(t(4),t(7), 50)';
p = polyval(flip(x(1:4)),t_p);
q = polyval(flip(x(5:8)),t_q);

figure;
plot(t([1:3,5:7]),b(1:6),'*')
hold on;
plot(t_p,p,'r-',t_p(50),p(50),'s');
hold on;
plot(t_q,q,'g-',t_q(1),q(1),'d');
grid on;
legend 'Data' 'Poly p' 'Poly p at t_4' 'Poly q' 'Poly q at t_4'
xlabel 't'; ylabel 'y'


3.2 Formulate the following problem as a set of linear equations Ar -b. Find two cubic polynomials that satisfy the following eight conditions: 12 ·P(4) q(4), p (4) q,(4). This specifies that at t-t4 the polynomials should have the same value The variables in the problem are the coefficients ri, , 28. The numbers 4, y, are given, with t1

Explanation / Answer

figure;
plot(t([1:3,5:7]),b(1:6),'*')
hold on;
plot(t_p,p,'r-',t_p(50),p(50),'s');
hold on;
plot(t_q,q,'g-',t_q(1),q(1),'d');
grid on;
legend 'Data' 'Poly p' 'Poly p at t_4' 'Poly q' 'Poly q at t_4'
xlabel 't'; ylabel 'y'

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote