HOW TO SOLVE THE BELOW ERROR

2 visualizzazioni (ultimi 30 giorni)
Dev
Dev il 18 Giu 2018
Commentato: Walter Roberson il 18 Giu 2018
Undefined function or variable 'repressilatorddt'.
Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);Error in repressilatorr (line 31) [t,s]=ode45(ODEFUN, [0,Tend], x0, options);
IN PROGRAM %file repressilator.m %Model of repressilator oscillatory genetic circuit %from Elowitz and Leibler (2000) Nature 403, pp 335-338. %Figure 7.21
function repressilatorr
clear all
%declare model parameters global alpha global alpha0 global n global beta
%assign parameter values alpha0=60*(5e-4); %transcripts/sec alpha=60*(5-alpha0); %transcripts/sec n=2; beta=1/5;
%set simulation parameters Tend=1000 ODEFUN=@repressilatorddt; options=odeset('Refine', 6);
%set initial condition: state = [m1 p1 m2 p2 m3 p3] x0=[0.2 0.1, 0.3 0.1 0.4 0.5]';
%run simulation [t,s]=ode45(ODEFUN, [0,Tend], x0, options);
%produce figure 7.21A figure(1) set(gca,'fontsize',14) t=t/0.3485 plot(t,40*s(:,2), 'k',t,40*s(:,4), 'k--', t,40*s(:,6), 'k:','Linewidth', 3) axis([0 800 0 7000]) ylabel('protein abundance (molecules per cell)') xlabel('Time (min)') legend('Protein 1', 'Protein 2', 'Protein 3')
  1 Commento
Walter Roberson
Walter Roberson il 18 Giu 2018
You need to define a function repressilatorddt which you would probably store in repressilatorddt.m
Note: you should never have "clear all" in a function, and you should rarely have "clear all" in a script either.

Accedi per commentare.

Risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by