How to store output of dde23 command in workspace

1 次查看(过去 30 天)
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

采纳的回答

Jackson Burns
Jackson Burns 2019-9-7
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()

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by