function[y]= hw3question1a(t,y) y=1; h=.02; t=0; f=(3*exp(-(4*t)))-2*y; for i=1:50 t(i+1)=t(i)+h; y(i+1)=y(i)+h*f(t(i),y(i)); plot(t,y,'r--') xlabel('t'); ylabel('y') title('Eulers Method for function question1') end
MATLAB: How can i modify this for loop to only give “integer indices values”
beginnerforloopfunctionindices
Related Question
- Am I getting “Array indices must be positive or integers values”
- About matlab coder causing “Integer divide by zero” crash after updating windows 10 to 1803 version
- Do I get “Array indices must be positive integers or logical values”
- How to call functions properly: Index in position 1 is invalid. Array indices must be positive integers or logical values.
Best Answer