fanghuikeer 发表于 2006-10-12 16:02

函数作图求助

syms t y
f=int('abs(cos(t/2)+y*sin(pi*z))','z',0,1)
y =

exp(-1/2*t)*sin(1/2*3^(1/2)*t)*C2+exp(-1/2*t)*cos(1/2*3^(1/2)*t)*C1+8/13*sin(1/2*t)-f+12/13*cos(1/2*t)
我想把上面的y关于t函数图象画出来,初始条件为y(0)=0;dy(0)/dt=0,时间段长度随便取
我直接用了plot(y,t),但是不行,提示出错信息为:
plot(y,t)
??? Error using ==> plot
Conversion to double from sym is not possible.
清高手给些帮助与指点...

[ 本帖最后由 xinyuxf 于 2007-7-22 16:22 编辑 ]

eight 发表于 2006-10-12 16:07

原帖由 fanghuikeer 于 2006-10-12 16:02 发表
syms t y
f=int('abs(cos(t/2)+y*sin(pi*z))','z',0,1)
y =

exp(-1/2*t)*sin(1/2*3^(1/2)*t)*C2+exp(-1/2*t)*cos(1/2*3^(1/2)*t)*C1+8/13*sin(1/2*t)-f+12/13*cos(1/2*t)
我想把上面的y关于t函数图象画出来 ...


plot是把数据点描绘出来的函数,怎能用在符号变量中,符号变量只是一个表达式而已,另外,是plot(t,y),非plot(y,t)

建议楼主补补基础知识
页: [1]
查看完整版本: 函数作图求助