fx y 12 pi sigma2 ex mux2 y muy22 sigma2 Draw peaks at t

f(x, y) = 1/2 pi sigma^2 e^-[(x - mu_x)^2 + (y - mu_y)^2]/(2 sigma^2). Draw peaks at two locations in the given area. Each peak should have a different height. Change default surface colors

Solution

1. To draw peaks at two locations in the given area:

Use the peaks function to define X, Y, and Z as 10-by-10 matrices. Then, create a surface plot.

2. If each peak should have a different height:

>> surf(X,Y,Z) // Uses Z for the color data and surface height. X and Y are vectors or matrices defining the x and y components of a surface. If X and Y are vectors, length(X) = n and length(Y) = m, where [m,n] = size(Z). In this case, the vertices of the surface faces are (X(j), Y(i), Z(i,j)) triples. To create X and Y matrices for arbitrary domains, use the meshgrid function.

3. If you want to change default durfaces colors:

>>colormap name // Sets the colormap for the current figure to the built-in colormap specified by name. The new colormap uses the same number of colors as the current colormap. The figure colormap affects all axes in the figure, unless you set an axes colormap separately.

>>colormap default // Uses the default colormap, which is the parula colormap with 64 colors.

>>colormap(map) // Sets the colormap for the current figure to the colormap specified by map. The figure colormap affects all axes in the figure, unless you set an axes colormap separately. Use this syntax if you want to use a built-in colormap with a specific number of colors or if you want to use a custom colormap.

 f(x, y) = 1/2 pi sigma^2 e^-[(x - mu_x)^2 + (y - mu_y)^2]/(2 sigma^2). Draw peaks at two locations in the given area. Each peak should have a different height.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site