回 帖 发 新 帖 刷新版面

主题:求助,请教各位高手!!

各位高手!!!
    我想把函数(1e-3)*sin(0.3*pi*t)*exp(-((3*t-100)^2)/2000)的图象划出来!
    编程如下:
clear
clc
syms t f
f=(1e-3)*sin(0.3*pi*t)*exp(-((3*t-100)^2)/2000)
t=0:1:100
subplot(2,1,1)
plot(t,f)
grid
    图象显示不出来!!!请高手指点!!!万分感谢!!!

回复列表 (共1个回复)

沙发

因为你定义的是符号变量,所以运行时出现Error using ==> plot
Conversion to double from sym is not possible.

Error in ==> d:\MATLAB6p5\work\Untitled.m
On line 9  ==> plot(t,f)

因此必须将符号变量转换过来,以下为正确程序:
clear
clc
syms t f
f=(1e-3)*sin(0.3*pi*t)*exp(-((3*t-100)^2)/2000);
t=subs(t);
t=0:1:100
f=subs(f);
subplot(2,1,1)
plot(t,f)
grid

有空多交流lixue_9808@163.com

我来回复

您尚未登录,请登录后再回复。点此登录或注册