I'm using the DERIVESTsuite toolbox to find the jacobian with respect to a state array over time. I have a function with inputs
1. `x`- state array (n x m). Where n is the number of states and m is the number of time nodes.
2. `u`- control vector (1 x m)
3. `t`- time vector (1 x m)
4. `constants`- structure of constants
I currently have my code looping through each time node to give me an nxn matrix for each time node.:
for i = length(t):-1:1
A(:,:,i) = jacobianest(@(x) eom(x,u(i),t(i),constants),x(:,i));
Is there a way to do this without looping through each time node? I know that the following code gives me a matrix A which is (n*m x n*m).
A = jacobianest(@(x) F(x,u,t,constants),x);
Can I extract what I'm looking for from this or is there a better way to use jacobianest?