- 积分
- 16
- 注册时间
- 2006-6-3
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2008-4-7 00:09:32
|
显示全部楼层
来自 美国
回复 1# 的帖子
ezplot('4/(5-cos(x))',[-6 6 -1 1]) % no problem
Since '4/(5-cos(x))' is a string(chars), it is converted to an inline function as like y=4/(5-cos(x)) .
t=taylor('4/(5-cos(x))',10) % expand 10th Taylor order
ezplot(t) % It is no problem also
Note that t is no longer a string, it is a symbolic expression(object) now!
ezplot(t,[-6 6 -1 1]) % It has so many problem
In this form, t is expected to be a two variable implicit function( or symbolic expression), such as f(x,y). But you feed in a single variable expression. It then reports error. Solution:- syms x, y
- t=taylor(4/(5-cos(x)),10)-y
- ezplot(t,[-6 6 -1 1])
复制代码 On the other hand, when handling symbolic expressions, ezplot is not as nice as it handles strings. |
评分
-
1
查看全部评分
-
|