How to store output of dde23 command in workspace

1 Ansicht (letzte 30 Tage)
Joy Mondal
Joy Mondal am 6 Sep. 2019
Kommentiert: Jackson Burns am 7 Sep. 2019
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

Akzeptierte Antwort

Jackson Burns
Jackson Burns am 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()
  2 Kommentare
Joy Mondal
Joy Mondal am 7 Sep. 2019
Bearbeitet: Joy Mondal am 7 Sep. 2019
Thank you Jackson
Jackson Burns
Jackson Burns am 7 Sep. 2019
You're welcome!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by