% start Matlab from Anaconda prompt close all; clear; % Solve differential equation m = py.gekko.GEKKO(pyargs('remote','False')); % Solve on local machine m.time = py.numpy.linspace(0,20,100); k = 10; y = m.Var(5.0); t = m.Param(m.time); m.Equation(k*y.dt()==-t*y); m.options.IMODE = 4; m.solve() % retrieving the values is a little more complicated here time = cellfun(@double,cell(m.time.tolist())); y = cellfun(@double,cell(y.VALUE.value)); plot(time,y) xlabel('Time') ylabel('y')