function must return a column vector
Hi, i am trying to plot some graphs for my my theses but i keep on getting error message..
find attached the code.. please help
function Juve_Model
clc;
%close all
global NO
%initial condition
Initial1 = [100,30,10,30];
hold on
for i=1:2:10
Initial=Initial1*i;
[t,u]=ode45(@hcv4,0:0.5:90, Initial);
subplot(2,2,1)
grid on
hold on
%axis([0 1400 0 1]);
plot(t,u(:,1),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘L’)
%*********************************************
subplot(2,2,2)
grid on
hold on
plot(t,u(:,2),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘F_1’)
%********************************************
subplot(2,2,3)
grid on
hold on
plot(t,u(:,3),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘F_2’)
%*******************************************
subplot(2,2,4)
grid on
hold on
plot(t,u(:,4),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘M’)
end
NO
end
function dy=hcv4(t,y)
%y=(L, F_1,F_2,M)=(y(1),y(2),y(3),y(4))
global NO
alpha=15; beta=0.1; q=0.3; gamma =0.7;
%beta=0.15; q=0.35; gamma=0.75;
K=1000; mu_L=0.35; d=0.45; mu_F1=0.15; mu_M=0.15; mu_F2=0.5;
% Basic Offspring (Reproduction) Number
NO=alpha*gamma*beta*q/(mu_F2*(mu_F1+gamma)*(beta+mu_L+d));
%Ordinary differential equation
dy(1)=alpha*(1-y(1)/K)*y(3)-(beta+mu_L+d)*y(1);
dy(2)=beta*q*y(1)-(mu_F1+gamma)*y(2);
dy(3)=gamma*y(2)-mu_F2*y(3);
dy(4)=beta*(1-q)*y(1)-mu_M*y(4);
endHi, i am trying to plot some graphs for my my theses but i keep on getting error message..
find attached the code.. please help
function Juve_Model
clc;
%close all
global NO
%initial condition
Initial1 = [100,30,10,30];
hold on
for i=1:2:10
Initial=Initial1*i;
[t,u]=ode45(@hcv4,0:0.5:90, Initial);
subplot(2,2,1)
grid on
hold on
%axis([0 1400 0 1]);
plot(t,u(:,1),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘L’)
%*********************************************
subplot(2,2,2)
grid on
hold on
plot(t,u(:,2),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘F_1’)
%********************************************
subplot(2,2,3)
grid on
hold on
plot(t,u(:,3),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘F_2’)
%*******************************************
subplot(2,2,4)
grid on
hold on
plot(t,u(:,4),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘M’)
end
NO
end
function dy=hcv4(t,y)
%y=(L, F_1,F_2,M)=(y(1),y(2),y(3),y(4))
global NO
alpha=15; beta=0.1; q=0.3; gamma =0.7;
%beta=0.15; q=0.35; gamma=0.75;
K=1000; mu_L=0.35; d=0.45; mu_F1=0.15; mu_M=0.15; mu_F2=0.5;
% Basic Offspring (Reproduction) Number
NO=alpha*gamma*beta*q/(mu_F2*(mu_F1+gamma)*(beta+mu_L+d));
%Ordinary differential equation
dy(1)=alpha*(1-y(1)/K)*y(3)-(beta+mu_L+d)*y(1);
dy(2)=beta*q*y(1)-(mu_F1+gamma)*y(2);
dy(3)=gamma*y(2)-mu_F2*y(3);
dy(4)=beta*(1-q)*y(1)-mu_M*y(4);
end Hi, i am trying to plot some graphs for my my theses but i keep on getting error message..
find attached the code.. please help
function Juve_Model
clc;
%close all
global NO
%initial condition
Initial1 = [100,30,10,30];
hold on
for i=1:2:10
Initial=Initial1*i;
[t,u]=ode45(@hcv4,0:0.5:90, Initial);
subplot(2,2,1)
grid on
hold on
%axis([0 1400 0 1]);
plot(t,u(:,1),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘L’)
%*********************************************
subplot(2,2,2)
grid on
hold on
plot(t,u(:,2),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘F_1’)
%********************************************
subplot(2,2,3)
grid on
hold on
plot(t,u(:,3),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘F_2’)
%*******************************************
subplot(2,2,4)
grid on
hold on
plot(t,u(:,4),’linewidth’,3);
xlabel(‘Time (days)’)
ylabel(‘M’)
end
NO
end
function dy=hcv4(t,y)
%y=(L, F_1,F_2,M)=(y(1),y(2),y(3),y(4))
global NO
alpha=15; beta=0.1; q=0.3; gamma =0.7;
%beta=0.15; q=0.35; gamma=0.75;
K=1000; mu_L=0.35; d=0.45; mu_F1=0.15; mu_M=0.15; mu_F2=0.5;
% Basic Offspring (Reproduction) Number
NO=alpha*gamma*beta*q/(mu_F2*(mu_F1+gamma)*(beta+mu_L+d));
%Ordinary differential equation
dy(1)=alpha*(1-y(1)/K)*y(3)-(beta+mu_L+d)*y(1);
dy(2)=beta*q*y(1)-(mu_F1+gamma)*y(2);
dy(3)=gamma*y(2)-mu_F2*y(3);
dy(4)=beta*(1-q)*y(1)-mu_M*y(4);
end global stability MATLAB Answers — New Questions