How to store output of dde23 command in workspace

1 view (last 30 days)
function ddex1
global k1 k2 k3 zf wf a b g d f m w wn
a=-0.01; b=0.05; g=14.4108; d=3.2746; f=0.01;m=0.89663; w=3.06309;
wn=3.06309;wf=3.1;zf=0.1; k1=-0.1; k2=1;k3=-0.5;
sol = dde23(@ddex1tde,[0.1],@ddex1histd,[0, 1000])
% figure;
plot(sol.x,sol.y(1,:))
xlabel('time t');
ylabel('solution y');
I got the output in the form of graph from this command. Now I want to store the output data to workspace

Accepted Answer

Jackson Burns
Jackson Burns on 7 Sep 2019
I can't run this on my machine without the function ddex1histd, but here's my best idea:
Have the function return sol and assign it to some value in your workspace.
function sol = ddex1
global k1 k2 k3 zf wf a b g d f m w wn
a=-0.01; b=0.05; g=14.4108; d=3.2746; f=0.01;m=0.89663; w=3.06309;
wn=3.06309;wf=3.1;zf=0.1; k1=-0.1; k2=1;k3=-0.5;
sol = dde23(@ddex1tde,[0.1],@ddex1histd,[0, 1000])
% figure;
plot(sol.x,sol.y(1,:))
xlabel('time t');
ylabel('solution y');
Function call:
out = ddex1()

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!