How to label answers from a function you called in a script?
Show older comments




When i call the ODESystemSolver i get two answers back. But how can i label them in the code. Basically need those two answers to input them into my secant method function to get a new approximations then repeat the step. i added a picture of what im trying to do i hope its understandable. Sorry for long question
Answers (1)
darova
on 15 Oct 2019
You just want to pass your functions to SecantMethod if i understood your correctly
Type this in the main script
syms x1(t) lambda1(t)
x1(t) = ODE.x; % get solution functions
lambda1(t) = ODE.lambda;
t = linspace(0,2); % time span
x0 = x1(t); % numeric solution
l0 = lambda1(t);
% pass values to SecantMethod
for i = 1:length(t)-1
lam1 = SecanthMethod([x0(i:i+1); l0(i:i+1)]);
if lam1 what?
break
end
end
Categories
Find more on Linear Algebra 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!