error in code
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (3)
Jiro Doke
el 28 de Feb. de 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.
1 comentario
Srinivas
el 28 de Feb. de 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 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!