Euler method error in code Index exceeds the number of array elements (1). in my my code
古いコメントを表示
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 件のコメント
Bhaskar R
2019 年 11 月 17 日
Can you provide variables, x,y ?
Anas Lunat
2019 年 11 月 17 日
編集済み: Anas Lunat
2019 年 11 月 17 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!