error in code
1 view (last 30 days)
Show older comments
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 Comments
Answers (3)
Jiro Doke
on 28 Feb 2012
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
on 28 Feb 2012
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 Comments
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!