Solving using Euler method
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
time_step= 0.005; time=0:time_step:0.2;
y(1)=0;
for x=1:length(time)-1, E=50-20*y(i); y(i+1)=y(i)+E*time_step; end plot(time,y)
im having problem with the coding... there's error in these but im unsure what the error is, can some1 please explain...
**Subscript indices must either be real positive integers or logicals. for x=1:length(time)-1, E=50-20*y(i);
댓글 수: 0
답변 (1개)
Matt Fig
2011년 4월 9일
0 개 추천
What is 'i'? In MATLAB , 'i' and 'j' are functions. This is one reason why it is recommended not to use them as loop indices.
Where in your code do you assign 'i'?
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!