%%% Matlab code %%
clc;
close all;
clear all;
[x,y]=meshgrid(-2:0.1:2);
z=x.*exp(-((x-y.^2).^2+y.^2));
figure;
surf(x,y,z);
xlabel('x');
ylabel('y');
zlabel('z');
figure;
contour(x,y,z);
xlabel('x');
ylabel('y');
zlabel('z');
OUTPUT:


Problem 2: Create a surface plot and a contour plot of the function f(x, y) =...
Create a surface plot and a contour plot of the function z=(x-2)^2+2xy+y^2. Using the matlab
Create a surface plot, contour plot, and mesh plot of the function z = e^(a+jb) for the interval −1 ≤ a ≤ 1 and −2π ≤ b ≤ 2π. Plot the real part of z versus a and b for each of these plots.
6. Plot the 3D surface and contour levels of the following function: z(x, y)cos(2y-x) sin(2x) such that-π x π and-r y < π [10 marks] 7. Create a 5 x 5 random matrix M6 with elements ranging from 10 to 33. Using indexing, define the following arrays: An array containing all elements of M6 that are greater than 3 and smaller 6 marks] An array containing all elements of M6 that are negative or between 29 and 33. 6 marks...
1). For the function, f(x) X-4X+2XY+2Y2+2Y+14 a. Plot the surface function for X over [5 61, and Y over [-4,-2]," b. Draw the contour plot for X over [0 10], and Y over [-4,-2] and values for the contours 1.25 1.5 2 25 3 of V c. Write an m-file to find the minimum of the function using the gradient descent method. Use a starting value of [4,-4].
1). For the function, f(x) X-4X+2XY+2Y2+2Y+14 a. Plot the surface function for...
ΜATLAB plotting problem
Clearly plot the function f (X) = x^2 - 4x - 5/x - 2 for -4 lessthanorequalto x lessthanorequalto 8. Notice that the function has a vertical asymptote at x=2. Avoid plotting the asymptote itself: Create two vectors for the domain of x (x1 for before the asymptote and x2 for after). Calculate the corresponding y arrays. Now appropriately plot oil 4 arrays in the same plot: y1 vs x1 and y2 vs x2.
this was the information that was provided to us.
2) Draw a contour diagram for a function f(x, y) such that at the point (, y) (0,0),
2) Draw a contour diagram for a function f(x, y) such that at the point (, y) (0,0),
Select the contour map of the function. f(x,y) = y/(x^2+y^2)
1) Create a matlab function that calculates:
for
Name your function TwoVarFunc :
The inputs should be in the same order:
xmin
xmax
ymin
ymax
N: n is the number of elements in the vector x and y
The ouputs should be in the same order:
f_xy: is the calculated array f(x,y)
f_xyMAX: should be the the maximum value of the function
f(x,y).
Hint: to create vectors x and y look up the matlab built-in
function linspace()
Hint 2: To...
2.1(9pts) Consider thc following contour plot for thc arbitrary function f(x,y): Y 0 2 Х -1 + 1. What is vf(0,0). Why? 2. At the point (0,2), in what direction should one move to increase the fastest? 3. Which vector has the greater magnitude: Vf(-1,0) or f(2,0)? CS Scanned with CamScanner
2) Use the function h(x,y)= as follows: 1+x2+y2+x+xy 2 2D optimization utilizing Excel · Produce a surface plot of the function Utilize Solver to find the optimum value o o 2D optimization utilizing Matlab o o o Produce a surface plot the function Produce a contour plot of the function Utilize fminsearch to find the optimum value