MATLAB求函数极限的简单介绍
一、问题引导
1.1、海底曲线绘制问题
1.2、绘制二维与三维图形
二、代码演示
2.2、二维与三维绘图案例
2.2.1、官方对plot函数的解释
总结
海底测量,低潮时海平面上一点(x,y)处的水深z,假定吃水深度为5米,绘制图形
2.1、海底曲线绘制
代码如下:
clear;close;
%先用plot方法观察测量点的位置
x=[129 140 108 88 185 195 105 157 107 77 145 162 162 117];
y=[7 141 28 147 22 137 85 -6 -81 3 45 -66 84 -38];
figure(1);
plot(x,y,'o');
%插值方法绘制完全的海平面
z=[4 8 6 8 6 8 8 9 9 8 8 9 4 9];
%吃水深度取其负值
h=-z;
xi=75:5:200;
yi=-50:10:150;
[X,Y]=meshgrid(xi,yi);
%cubic光滑曲面
H=griddata(x,y,h,X,Y,'cubic');
figure(2);
surf(X,Y,H);
%等高线方法绘制出危险区域
figure(3);
contour(X,Y,H,[-5,-5]);
结果显示:
plot(
creates a 2-D line plot of the data in X
,Y
)Y
versus the corresponding values in X
.
If X
and Y
are both vectors, then they must have equal length. The plot
function plots Y
versus X
.
If X
and Y
are both matrices, then they must have equal size. The plot
function plots columns of Y
versus columns of X
.
If one of X
or Y
is a vector and the other is a matrix, then the matrix must have dimensions such that one of its dimensions equals the vector length. If the number of matrix rows equals the vector length, then the plot
function plots each matrix column versus the vector. If the number of matrix columns equals the vector length, then the function plots each matrix row versus the vector. If the matrix is square, then the function plots each column versus the vector.
If one of X
or Y
is a scalar and the other is either a scalar or a vector, then the plot
function plots discrete points. However, to see the points you must specify a marker symbol, for example, plot(X,Y,'o')
.
plot(X,Y) 创建 Y 中的数据与 X 中相应值的二维线图。
绘制二元函数的图形案例
代码演示
%二元函数的图形
clear;close;
%建立绘图基面
[x,y]=meshgrid([-10:0.1:10],-10:0.1:10);
%建立两个方程
z1=x.^2-2*y.^2+eps;
a=input('a=(-50
以上就是今天的内容,主要介绍ATLAB绘图函数的相关介绍——海底测量、二维与三维图形绘制。
最后欢迎大家点赞,收藏⭐,转发,
如有问题、建议,请您在评论区留言哦。