声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 861|回复: 1

[编程技巧] 求助,出错了?

[复制链接]
发表于 2007-4-1 20:29 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
figure('pos',[120,130,300,300],'color','w');
axes('pos',[0.1 0.15 0.8 0.72]);
syms s t
T=2;K=1;
T1=sym(num2str(T));K1=sym(num2str(K));
m0=2;e0=2;gs=m0/e0;rt=2;et1=rt;
for tt=0:0.05:20;
    if et1>e0,eout=m0;
    elseif et1<-e0,eout=-m0;
    else eout=gs*et;
    end
    ee=sym(num2str(eout));
    y1=ilaplace(K1*ee/s/(T1*s^2+s+1));
    et=rt-y1;det=diff(et);
    et1=subs(et,tt);det1=subs(det,tt);
    plot(et1,det1);hold on;
end
grid

??? Function 'max' is not defined for values of class 'sym'.

Error in ==> num2str at 70
        xmax = double(max(abs(x(:))));

是什么错误呢?
回复
分享到:

使用道具 举报

发表于 2007-4-1 20:38 | 显示全部楼层
原帖由 jennychung 于 2007-4-1 20:29 发表
figure('pos',,'color','w');
axes('pos',);
syms s t
T=2;K=1;
T1=sym(num2str(T));K1=sym(num2str(K));
m0=2;e0=2;gs=m0/e0;rt=2;et1=rt;
for tt=0:0.05:20;
    if et1>e0,eout=m0;
    elseif e ...



max 函数不支持符号变量,建议先阅读matlab基础书,而不是一遇到问题就发问
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-24 19:16 , Processed in 0.056723 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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