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

Missing operator, comma, or semicolon,这个错误怎么搞得?

[复制链接]
发表于 2004-12-16 22:04:03 | 显示全部楼层 |阅读模式 来自 同济大学
matrix.m
function c=matrix(n,t)   
N=10*2.^(n-1);
   for i=2:N+2;
   h=2./N;
   b(i)=-1+(i-2)*h;
end
   for i=1:N+3
       if i==1
           c(i)=feval('f1',-1);
       elseif i==N+3
           c(i)=feval('f1',1);
       else
   c(i)=feval('f',b(i));
end
end

f1.m
function y=f1(t)
y=4t.^3;

f.m
function y=f(t)
y=t.^4;

>>syms t
>>n=7
>>c=matrix(n,t)

??? Error: File: F:\MATLABR13\work\f1.m Line: 2 Column: 4
Missing operator, comma, or semicolon.

Error in ==> F:\MATLABR13\work\matrix.m
On line 9  ==>            c(i)=feval('f1',-1);
 楼主| 发表于 2004-12-16 22:04:58 | 显示全部楼层 来自 同济大学

Re:Missing operator, comma, or semicolon,这个错误怎么搞得?

Simdroid开发平台
救命啊,
发表于 2004-12-17 09:53:10 | 显示全部楼层 来自 江西景德镇

Re:Missing operator, comma, or semicolon,这个错误怎么搞得?

y=4*t.^3;
这样的问题在发帖子之前仔细检查。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-22 11:05 , Processed in 0.040849 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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