Graph 通过将6个图更改为3个图来套印

Graph 通过将6个图更改为3个图来套印,graph,matplotlib,plot,matlab-figure,Graph,Matplotlib,Plot,Matlab Figure,两个M文件一个包含微分方程,另一个用于运行和绘制图形。因为我使用的是ode解算器,所以它有两个文件要运行 有4个MATLAB代码,其中4个单独的MATLAB M-FLIES,但2个M-file用于生成3个图,另外2个M-file用于生成另外3个图。但我只想把这6个地块过度地画成3个地块 这是前两个M文件, 一个包含微分方程,另一个包含绘制图形。 因为我使用的是ode解算器,所以它有两个文件 % Creating recent original 3 ode without scaling any

两个M文件一个包含微分方程,另一个用于运行和绘制图形。因为我使用的是ode解算器,所以它有两个文件要运行

有4个MATLAB代码,其中4个单独的MATLAB M-FLIES,但2个M-file用于生成3个图,另外2个M-file用于生成另外3个图。但我只想把这6个地块过度地画成3个地块

这是前两个M文件, 一个包含微分方程,另一个包含绘制图形。 因为我使用的是ode解算器,所以它有两个文件

% Creating recent original 3 ode without scaling any parameters and c.

  function xprime= ns(t,x)

  I=1200; % light intensity

  %values of parameters
    k_f= 6.7*10.^7;
    k_d= 6.03*10.^8; 
    k_n=2.92*10.^9; 
    k_p=4.94*10.^9;
    alpha =1.14437*10.^-3;

    %Unknown parameters
    lambda_b= 0.0087;
    lambda_r =835; 
    gamma =2.74; 

    %Pool Values
    P_C= 3 * 10.^(11);
    P_Q= 2.87 * 10.^(10); 

 % initial conditions
  c=x(1);
  s=x(2);
  q=x(3);

  %Non-linear differential equations.
  % dc/dt= alpha*I + c(- k_f - k_d - k_n * s - k_p*(1-q))
  % ds/dt = lambda_b * c* P_C *(1-s)- lambda_r *(1-q)*s
  % dq/dt = (1-q)* k_p * c *(P_C / P_Q)- gamma * q

 xprime = zeros(3,1);    % a column vector

xprime(1)= alpha*I + c*(- k_f - k_d - k_n * s - k_p*(1-q));
xprime(2)= lambda_b *(1-s)*c* P_C  - lambda_r *(1-q)*s;
xprime(3)=(1-q)*k_p* c*(P_C / P_Q)- gamma * q;

% TO RUN the recent original odes with t= 0.2 *10^-9

  format bank
  close all; 
  clear all; 
  clc; 
epison= 10.^-9;
  %time interval
  ti=0; 
  tf=0.2*epison; 
  tspan=[ti tf]; 

  x0=[0.25 0.02 0.98]; %initial conditions

  %time interval of [0 2] with initial condition vector [0.25 0.02 0.98] at time 0.
  options= odeset('RelTol',1e-9, 'AbsTol',[1e-9 1e-9 1e-9]);
  [t,x]= ode23s(@ns,tspan,x0,options); 
dt = t(2:end)-t(1:end-1);  % number of time step size it is using

%Plotting the graphs:
plot(t(2:end), t(2:end)-t(1:end-1));   % plotting the time step size.
 title('Time steps for 3 recent original odes (c,s,q), time =0.2*10^-9 ');
ylabel('t'), xlabel('t_n'); 

  figure 
  subplot(3,1,1), plot(t,x(:,1),'r'),grid on; 
  title('3 recent original odes, time =0.2*10^-9 '),ylabel('c'); 

  subplot(3,1,2), plot(t,x(:,2),'b'),grid on; 
  ylabel('s'); 

  subplot(3,1,3), plot(t,x(:,3),'g'),grid on; 
  ylabel('q');xlabel('Time') 
另一个单独的两个M文件包含微分方程,另一个包含用于绘制图形的文件。因为我使用的是ode解算器,所以它有两个文件

% 3 Asymptotic expansion t=0.2*10^-9 which gives tau =0.2


  function xpr= no(t,x)
    epison= 10.^-9; 
  %values of parameters
    k_f= 6.7*10.^7;
    k_d= 6.03*10.^8; 
    k_n=2.92*10.^9; 
    k_p=4.94*10.^9;

    %Unknown parameters
    lambda_b= 0.0087;

    % scale parameters
    K_F= k_f *   epison;
    K_D= k_d *   epison; 
    K_N= k_n *   epison; 
    K_P= k_p *   epison;
    LAMBDA_B= lambda_b*  epison;

    %Pool Values
    P_C= 3 * 10.^(11);
    P_Q= 2.87 * 10.^(10); 

 % initial conditions
  c_0=x(1);
  s_0=x(2);
  q_0=x(3);

  %Non-linear differential equations.
  % dc_0/dtau=  c_0*(- K_F - K_D - K_N * s_0 - K_P*(1-q_0))
  % ds_0/dtau = Lambda_B * c* P_C *(1-s_0)
  % dq_0/dtau = (1-q_0)* K_P * c_0 *(P_C / P_Q)


  % dc_0/dt=  c_0*(- K_F - K_D - K_N * s_0 - K_P*(1-q_0))
  % ds_0/dt = Lambda_B * c_0* P_C *(1-s_0)
  % dq_0/dt = (1-q_0)* K_P * c_0 *(P_C / P_Q)

xpr= zeros(3,1);

xpr(1)=c_0*(- K_F - K_D - K_N * s_0 - K_P*(1-q_0));
xpr(2)= LAMBDA_B * c_0*P_C *(1-s_0);
xpr(3)= (K_P * c_0*P_C*(1-q_0)) / P_Q;

% TO RUN 3 asymptotic expansion for c_0,s_0 and q_0

  format bank
  close all; 
  clear all; 
  clc; 
epison= 10.^-9;

  %time interval
  ti=0; 
  tf=0.2*epison; 
  tspan=[ti tf]; 

  x0=[0.25 0.02 0.98]; %initial conditions

  %time interval of [0 2] with initial condition vector [0.25 0.02 0.98] at time 0.
  options= odeset('RelTol',1e-9, 'AbsTol',[1e-9 1e-9 1e-9]);
  [t,x]= ode23s(@no,tspan,x0,options); 
dt = t(2:end)-t(1:end-1); % number of time step size it is using

%Plotting the graphs:
  plot(t(2:end), t(2:end)-t(1:end-1));   % plotting the time step size.
   title('Time steps for 3 asymptotic expansions (c_0,s_0, q_0) at tau=0.2');
  ylabel('t'), xlabel('t_n'); 

  figure 
  subplot(3,1,1), plot(t,x(:,1),'r'),grid on; 
  title('3 asymptotic expansion when t=0.2*epsion, tau= t/epison, so tau=0.2'),ylabel('c_0'); 

  subplot(3,1,2), plot(t,x(:,2),'b'),grid on; 
  ylabel('s_0'); 

  subplot(3,1,3), plot(t,x(:,3),'g'),grid on; 
  ylabel('q_0');xlabel('Time') 
这两个单独的m文件中有6个图,每个图包含3个,并且有不同的。现在我想通过将6个图合并成3个图来过量绘制3个图。我的意思是一个包含c和c_0的过量批次,另一个用于s和s_0,最后一个用于q和q_0,总共3。 这3个图的时间间隔可以在0到0.2*10-9之间。
请帮帮我。我将非常感激你的帮助

为什么要用R标记?R是在matlab中绘制的