Euler method error in code Index exceeds the number of array elements (1). in my my code
Mostrar comentarios más antiguos
my code
b=input('enter the starting value of b here ')
a=input('enter the starting value of a here ')
h= 15
i=600
x(1)= 0
y(1)= 0
for n=1:h:i
x(n+1)=x(n)+(a(400-x(n)))/(sqr((400-x(n))^2+(y(n)^2)))*h
y(n+1)=y(n)+(b-((a*y(n))/(sqr((400-x(n))^2+(y(n)^2)))))*h
if x <= 400
break
end
end
plot(x,y,'r')
2 comentarios
Bhaskar R
el 17 de Nov. de 2019
Can you provide variables, x,y ?
Anas Lunat
el 17 de Nov. de 2019
Editada: Anas Lunat
el 17 de Nov. de 2019
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!