找回密码
 注册
Simdroid-非首页
查看: 58|回复: 1

taylor 基数的方程画法

[复制链接]
发表于 2008-4-6 21:32:57 | 显示全部楼层 |阅读模式 来自 韩国
现在在学习matlab里面的一些命令,
遇到了一些奇怪的问题:
ezplot('4/(5-cos(x))',[-6 6 -1 1]) % no problem


问题在下面的操作:
t=taylor('4/(5-cos(x))',10) % expand 10th Taylor  order
ezplot(t) %  It is no problem also
ezplot(t,[-6 6 -1 1]) % It has so many problem

??? Error using ==> figure
Single input must be an existing figure handle or a scalar integer from 1 to 2033136112
Error in ==> ezplot>determineAxes at 534
    figure(fig);
Error in ==> ezplot>ezplot1 at 428
    cax = determineAxes(fig);
Error in ==> ezplot at 148
    [hp,cax] = ezplot1(cax,f{1},vars,labels,args{:});
Error in ==> sym.ezplot at 57
      h = ezplot(f.s,varargin{:});
不懂了,希望能得到帮助
发表于 2008-4-7 00:09:32 | 显示全部楼层 来自 美国

回复 1# 的帖子

Simdroid开发平台
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:
  1. syms x, y
  2. t=taylor(4/(5-cos(x)),10)-y
  3. ezplot(t,[-6 6 -1 1])
复制代码
On the other hand, when handling symbolic expressions, ezplot is not as nice as it handles strings.

评分

1

查看全部评分

回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-9-25 23:18 , Processed in 0.038039 second(s), 18 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表