# need help with writing a script that will solve the problem here is what i started with

1 view (last 30 days)
Jason Hale on 25 Nov 2020
Edited: Jason Hale on 25 Nov 2020
i have my answer inverted from what it should be
Z = X^2 /3 +2*sin(3*Y), for -4 ≤ X ≤ 4 and -4 ≤ Y ≤ 4
syms x y z
x =( -4 : 0.1 : 4 );
y =( -4 : 0.1 : 4 );
[X,Y] = meshgrid(x,y)
Z = (X^2)/3 + (2*sin(3*Y))
surf(X,Y,Z)
xlabel('x')
ylabel('y')
zlabel('z')

KSSV on 25 Nov 2020
What have you attempted?
Steven Lord on 25 Nov 2020
This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.

KSSV on 25 Nov 2020
Hints:
x = linspace (0,1,100);
y = linspace (0,1,100);
[X, Y] = meshgrid (x, y);
Z = X. ^ 2 + Y. ^ 2;
surf (X, Y, Z)
colorbar 