matlab primer 7th edition phần 5

MATLAB lưu trữ mảng theo thứ tự lớn cột, trong khi các quy ước cho C là để lưu trữ chúng để hàng lớn. Ngoài ra, số lượng cột trong một mảng là không biết cho đến khi mexFunction được gọi là. Vì vậy, các mảng hai chiều trong MATLAB phải được truy cập với onedimensional lập chỉ mục trong C (xem cũng Phần ). | Q or File Save. This saves the figure as a .fig file which can be later opened in the Figure window with the open button or with File Open. Selecting File Export Setup or File Save As allows you to convert your figure to many other formats. 13. Three-Dimensional Graphics MATLAB s primary commands for creating threedimensional graphics of numerically-defined functions are plot3 mesh surf and light. Plotting of symbolic functions is discussed in Chapter 16. The menu options and commands for setting axes scaling and placing text labels and legends on a graph also apply for 3-D graphs. A zlabel can be added. The axis command requires a vector of length 6 with a 3-D graph. Curve plots Completely analogous to plot in two dimensions the command plot3 produces curves in three-dimensional space. If x y and z are three vectors of the same size then the command plot3 x y z produces a perspective plot of the piecewise linear curve in three-space passing through the points whose coordinates are the respective elements of x y and z. These vectors are usually defined parametrically. For example t .01 .01 20 pi x cos t 78 y sin t z plot3 x y z produces a helix that is compressed near the x-y plane a slinky . Try it. Mesh and surface plots The mesh command draws three-dimensional wire mesh surface plots. The command mesh z creates a threedimensional perspective plot of the elements of the matrix z. The mesh surface is defined by the z-coordinates of points above a rectangular grid in the x-y plane. Try mesh eye 20 . Similarly three-dimensional faceted surface plots are drawn with the command surf. Try surf eye 20 . To draw the graph of a function z f x y over a rectangle first define vectors xx and yy which give partitions of the sides of the rectangle. The function x y meshgrid xx yy then creates a matrix x each row of which equals xx whose column length is the length of yy and similarly a matrix y each column of which equals yy. A matrix z to which mesh or surf can

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
6    99    2    01-07-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.