声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2778|回复: 1

[综合讨论] 求助!Function definitions are not permitted at the prompt or in scripts

[复制链接]
发表于 2009-4-18 13:07 | 显示全部楼层 |阅读模式

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

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

x
function xdot = lorenzeq(t,x)
xdot=[-8/3*x(1)+x(2)*x(3);
-10*x(2)+10*x(3);
-x(1)*x(2)+28*x(2)-x(3)];
t_final=100; x0=[0;0;1e-10];
[t,x]=ode45('lorenzeq',[0,t_final],x0);
plot(t,x),
figure; plot3(x(:,1),x(:,2),x(:,3)); axis([10 40 -20 20 -20 20]);
为什么每次运行之后都说出现错误呢?
??? function xdot = lorenzeq(t,x)
    |
Error: Function definitions are not permitted at the prompt or in scripts.

[ 本帖最后由 ChaChing 于 2009-4-18 14:05 编辑 ]
回复
分享到:

使用道具 举报

发表于 2009-4-18 14:04 | 显示全部楼层
Ref:
常见的程序出错问题整理 (eight)
http://forum.vibunion.com/forum/thread-46001-1-1.html

[ 本帖最后由 ChaChing 于 2009-4-18 14:11 编辑 ]
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-9-22 15:29 , Processed in 0.053414 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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