个性化阅读
专注于IT技术分析

MATLAB 2-D绘图

点击下载

二维绘图有许多特定的图形功能。它们被用作我们刚刚讨论的plot命令的替代方法。 MATLAB帮助中心列出了20多种类型的二维图。示例包括茎图, 阶梯图, 条形图, 饼图和罗盘图。

在这里, 我们将讨论MATLAB中的2D绘图功能。

MATLAB fplot()

它用于绘制特定极限之间的曲线。函数的形式必须为y = f(x), 其中x是指定极限的向量, y是与x大小相同的向量。

句法

fplot(fun, limits) //	A function fun is plotted in between the limit specified
fplot(fun, limits, linespace) // It allows plotting fun with line specification
fplot(fun, limits, tol) //  It allows plotting with relative error tolerance 'tol'.If not specified default tolerance will be 2e-3 ie .2%  accuracy.
fplot(fun, limits, tol, linespace)//	 It allows plotting with relative tolerance and line specification

例子

f(t)=t sin t, 0≤t≤10π
fplot ('x.*sin(x)', [0 10*pi])

输出

MATLAB fplot()

赞(0)
未经允许不得转载:srcmini » MATLAB 2-D绘图

评论 抢沙发

评论前必须登录!