Relative Content

Tag Archive for matlabindexingodefunction-call

How do I iterate over a vector’s index if calling it using a function handle when solving with ODE15s?

I’m trying to solve for a vector k (reaction constant) that gets updated every time T is updated, and that new value of k is used to find the next T and so on. But the first time T is called for each iteration of k should use the value of T corresponding to the same index of k, and the second time T is called (i.e. T_prev) should reference the value of the previous index. I’m not really sure what I’m doing wrong. I usually don’t use function handles unless I have to.