Peaks of Matlab, mesh, and meshgrid Functions

Source: Internet
Author: User

Peaks of Matlab, mesh, and meshgrid Functions



Peaks:

MATLAB provides a peaks function to generate a concave and convex surface. It contains three local vertices and three Local Minimization points. The equation is:


I:

Peaks: 49*49 matrix (n = 49) by default)


II:

Z = peaks (N): The larger the value of N, the smaller the interval between neighboring points. Therefore, the smoother the line. The returned Z is a two-dimensional matrix.

For details, refer to the peaks function code: Open peaks



Mesh:

Draw a three-dimensional graph

I:

If () = 3, () = 4, () = 5, () = 6, soMesh (x) indicates to draw a 3D Graph with (row, column) as (x, y) and value as Z.Therefore, the four points in this example are:

(, 3), (, 4), (, 5), and (, 6)


II:

Mesh (x, y, z) indicates to draw a 3D Graph with (x, y, z)


Meshc:

Draw 3D mesh and contour map



Meshz:

Draw 3D grids and line charts



Meshgrid:

I:

[X, y] = meshgrid), Then ,. X is the same matrix for each row, and Y is the same matrix for each column.


II:

[X, y] = meshgrid), Then ,.



Example:

Z = peaks (30 );

Mesh (z );



Surf:

Use the following method to draw a 3D surface map:

I:

Surf (X)


II:

Surf (x, y, z)



Surfl:

Draw a 3D curved surface with shadow



Surfc:

Draw a 3D surface map with Contour Lines




Shading:

Shading flat
% Each area is represented in different colors.

Shading faceted% Deepen the gridline Based on shading flat

Shading interp% Shadow Smoothing




Colormap:

Set the color of a 3D image. The specific color can be:

Graph window --> edit --> colormap... --> Tools --> standerd colormaps select

For example:Colormap prism



Alphamap:

Set the transparency color of the image, specifically:

Alphamap ('Default');

Alphamap ('Rampup');
Alphamap ('Rampdown');
Alphamap ('Vup');
Alphamap ('Vdown');
Alphamap ('Increase');
Alphamap ('Decrease');
Alphamap ('Spin');



If you do not know a function, you can:

Doc xxx% Open the Help page of function xxx

Help xxx% Output the help information of function XXX directly in the Command window


When defining a function in MATLAB, you can useNarginIndicates the number of input parameters passed to the function.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.