您的位置首页百科知识

Matlab常用函数——grid函数

Matlab常用函数——grid函数

的有关信息介绍如下:

Matlab常用函数——grid函数

Matlab的强大之处就在于其提供的很多基础函数,可以方便解决很多问题,本经验将讲解一些常用的Matlab函数。

grid函数:显示或隐藏轴网格线

有三个函数 grid on grid grid off

grid on 打开网格

x = linspace(0,10);

y = sin(x);

plot(x,y)

grid on

grid off 关闭网格

[X,Y,Z] = peaks;

surf(X,Y,Z)

grid off

grid 在 on 和 off 之间进行切换

x = linspace(0,10);

y = sin(x);

plot(x,y)

这时是没有网格的

输入 grid

x = linspace(0,10);

y = sin(x);

plot(x,y)

grid

再次输入grid

x = linspace(0,10);

y = sin(x);

plot(x,y)

grid

grid

网格消失