HOW TO SOLVE THE BELOW ERROR

조회 수: 2 (최근 30일)
Dev
Dev 2018년 6월 18일
댓글: Walter Roberson 2018년 6월 18일
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
Walter Roberson
Walter Roberson 2018년 6월 18일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by