Question

In MATLAB, generate a 3D plot as follows: Create 2 vectors x and y, both ranging...

  1. In MATLAB, generate a 3D plot as follows:
  1. Create 2 vectors x and y, both ranging from -5 to 5 with interval of 0.05 using linspace or colon operator.

  1. Generate grid of values X and Y using the vectors x and y.

  1. Define the variable Z as follows:

Z = 2X3 + 4Y2 + 7 +sinX3 + Y2

  1. Generate a surface and a mesh plot with the variables X,Y,Z. Show your plots.

Homework Answers

Answer #1

clc;

x = -5:0.05:5;

y = -5:0.05:5;

[X, Y] = meshgrid(x, y);

Z = 2*X.^3 + 4*Y.^2 + 7*sin(x).^3 + Y.^2;

figure()

surf(X,Y,Z)

figure()

mesh(X,Y,Z)

%surfplot

%meshplot

Know the answer?
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
Similar Questions
Use Matlab to solve the following (a) Create a plot with a sphere at the center...
Use Matlab to solve the following (a) Create a plot with a sphere at the center of the graph (origin) representing the sun with a radius of 6955000 km. Make sure that the outside of the sphere is painted in ’autumn’ colors. (Hint: look up the sphere() function, the colormap() function, and the surf() function). (b) Create a variable t ranging from 0 to 2? with increments of 0.01. (c) The following Table gives you important values needed to compute...
Q) a) create a matrix named as X of evenly spaced values from 0 to 50,...
Q) a) create a matrix named as X of evenly spaced values from 0 to 50, with an increment of 10. b) a) create a matrix named as Y of evenly spaced values from 500 to 1000, with an increment of 3. c)a) create a matrix named as Z, the value of the 1st row is from 1 to 10, 2nd row from 2 to 20 with increment of 2, 3rd row 3 to 12. using subplot divide the window...
Curve-Fit Function USING MATLAB Using the top-down design approach, develop a MATLAB function A8P2RAlastname.m that reads...
Curve-Fit Function USING MATLAB Using the top-down design approach, develop a MATLAB function A8P2RAlastname.m that reads data from a file and performs regression analysis using polyfit and polyval. The function shall have the following features: The input arguments shall include the file name (string), a vector of integers for the degrees of polynomial fits to be determined, and an optional plot type specifier (‘m’ for multiple plots, ‘s’ for a single plot - default). The data files will be text...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT