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

2 Ansichten (letzte 30 Tage)
Erik Ramirez
Erik Ramirez am 15 Okt. 2019
Beantwortet: darova am 15 Okt. 2019
fromatmedium.jpg
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

Antworten (1)

darova
darova am 15 Okt. 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

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by