ODE45 and 3D arrays
Show older comments
Hello,
I have a question about 3D-arrays and ODE45. I have a 3D array called "A". "A" contains a set of a matrices at different instants of time, so for example A(:,:,1) will give me a matrix at T_0 . I also have a equation that I need to solve using ODE45. btw all the matrices in A are 6X6. My equation is Phi_dot(:,:,k) = A(:,:,k)*Phi, I'm trying to integrate this, but I keep getting an error on "indices". I would really appreciate it if you could help me with this. Thank you. My code is below :
function [ Phi_dot ] = Phi( A, Phi, t )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
Phi_dot = A*Phi;
end
Phi_0 = eye(6);
tspan = [0 pi];
opts = odeset('RelTol',1e-12,'AbsTol',1e-12);
for k = 1:i
[t1, Phi] = ode45(@(t,Phi) Phi(A(:,:,k),Phi(:,:,k),t),tspan,Phi_0,opts);
end
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!