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

 Here is the MATLAB solution below for the question above. I

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 u1 = [0;1;1;-1;1;2]; u2 = [1;0;1;-1;2;1]; b = [6;6;3;7;2;6]; A = [u1.^2 2*u1.*u2 u2.^2 u1 u2 ones(6,1)]; x = A\b; P = [x(1) x(2); x(2) x(3)]; q = [x(4); x(5)]; r = x(6); [u1g, u2g] = meshgrid(-1:0.1:2, -1:0.1:2); f = P(1,1)*u1g.^2 + 2*P(1,2)*u1g.*u2g + P(2,2)*u2g.^2 + q(1)*u1g + q(2)*u2g + r; scatter3(u1,u2,b,100,'filled','MarkerEdgeColor','y','MarkerFaceColor',[1 0 0]) hold on; surf(u1g,u2g,f,'EdgeColor','none') legend 'Data' 'Quad f'

3.4 Express the following problem as a set of linear equations. Find a quadratic function f(ui,U2)= [ ul tag ] P11 P12 1 P12 P22Jlu2 that satisfies the following six conditions: f(-1,-1-7, f1,2)-2, f(2,1)-6 The variables in the problem are the parameters pi1, P12, P22, q1, q2 and r. Write the equations in matrix- vector form Ar-b, and solve the equations with MATLAB

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!