error in code
2 次查看(过去 30 天)
显示 更早的评论
I have this code:
h=1;
a1=linspace(0,0,100);
a2=linspace(0.8,0.8,100);
a3=linspace(-0.8,-0.8,80);
a4=linspace(0,0,120);
kat=[a1 a2 a3 a4];
x=[0.5 0.2 0.5];
k=[linspace(0,0,400);linspace(0,0,400)];
for i=1:1:400
k(i+1;:)=k(i;:)+h*F_tanker(x,kat(i)) ;
end
and when i try tu run it error occurs: Line: 11 Column: 6 Incomplete or misformed expression or statement.
0 个评论
回答(3 个)
Jiro Doke
2012-2-28
Read this line carefully:
k(i+1;:)=k(i;:)+h*F_tanker(x,kat(i)) ;
You have a couple of extra ; in the line.
Srinivas
2012-2-28
this line
k(i+1;:)=k(i;:)+h*F_tanker(x,kat(i)) ;
should be
k(i+1,:)=k(i,:)+h*F_tanker(x,kat(i)) ;
go through some tutorials that will help http://www.mathworks.com/academia/student_center/tutorials/launchpad.html
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!