MATLAB: How i can… meshgrid in matlab

homeworkmeshgrid

hi
how i can run this formula with this command: meshgrid
………………………..
formul: y=35.5+10.5×1+5.5×2+8x1x2

Best Answer

Try this:
xv = linspace(-1, 1, 20);
[x1,x2] = meshgrid(xv);
y = 35.5 + 10.5*x1 + 5.5*x2 + 8*x1.*x2;
figure
mesh(x1, x2, y)
grid on
set(gca, 'BoxStyle','full')
view(35, 35)
figure
contour(x1, x2, y)
Experiment to get the result you want.