Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Windows
      • Office
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Windows
      • Office
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/Illegal use of reserved keyword “end”

Illegal use of reserved keyword “end”

/ 2025-01-11
Illegal use of reserved keyword “end”
Matlab

I am running this MATLAB code but it is giving me illegal use of keyword end, I checked the whole code and it has all brackets closed also, here is code:
%SEIQR model (equilibrium solution with time delay)
S = 2.376543 ;% Initial number of susceptible people in million
E = 2.557000 ;%Number of exposed people in million
I = 0; % Initial number of infected people
Q = 0 ;% Initial quarantined number
R = 0 ;% Initial number of recovered people
r1 = 2.5 ;% average susceptible contact number
r2 = 0.5 ;% average quarantine contact number
alpha=0.922; % infection rate in exposed people
r=0.303; % rate of infection
d1=0; % average natural death rate
d2=0.001; % average covid induced death rate
beta1=0.80; %infection rate per infected person
beta2=0.0701; % infection rate per quarantined person
gamma1= 0.01;% recovery rate in exposed people
gamma2= 0.01;% recovery rate in infected people
gamma3= 0.05;% recovery rate in quarantined people
M=1;
h = 0.01 ;% differential time interval
T = h:h:500 ;
foridx = 1:length(T)-1;
S(idx+1) = S(idx) + h*(M-alpha*S(idx)*E(idx) – d1*S(idx)) ;
E(idx+1) = E(idx) + h*(-alpha*S(idx)*E(idx) – d1*E(idx) – r*E(idx)) ;
I(idx+1) = I(idx) + h*(r*E(idx) -d2*I(idx)-d1*I(idx)-gamma2*I(idx)-beta2*I(idx)) ;
Q(idx+1) = Q(idx) + h*(beta1*E(idx) + beta2*I(idx)-d1*Q(idx)-d2*Q(idx)-gamma1*Q(idx)) ;
R(idx+1) = R(idx) + h*(gamma1*Q(idx)+gamma2*I(idx)+gamma3*E(idx)-d1*R(idx)) ;
end
clear; clc;
beta = 1.9; % contact rate per day
a1 = 0.3; % quarantine rate in exposed people
a2 = 0.2; % quarantine rate in infected people
r=0.303;
gamma1= 0.02;% recovery rate in exposed people
gamma2= 0.02;% recovery rate in infected people
gamma3= 0.09;% recovery rate in quarantined people
mu= 0.06; % natural death rate
beta1=0.8;
beta2=0.0701;
tau =14; %time delay (incubation period)
M=1;
d1 = 0.04;% death rate in infected people
d2 = 0.02;% death rate in quarantined people
ddeSEIQR = @(t,y,Z) [M-beta*y(1)*y(3)-d1*y(1) ;
(beta*y(1)*y(3))-d1*exp(-mu*tau)*Z(2,1)-r*y(2)-gamma3*y(2)-beta1*y(2) ; %Z(2,1) approximates the delay in exposed population
beta*exp(-mu*tau)*Z(2,1)-d2*y(3)-d1*y(3)-gamma2*y(3)-beta2*y(3) ;
beta1*y(2)+beta2*y(3)-d1*y(4)-d2*y(4)-gamma1*y(4) ;
gamma1*y(4)+gamma2*y(3)+gamma3*y(2)-d1*y(5)] ;
sol = dde23(ddeSEIQR,[14,1], [0.99 0 0.01 0 0] , [0 , 100]) ;%dde23 (@. . . . , tau , history ,tspan ;
figure ;
plot(sol.x,sol.y(1,:), ‘r’, LineWidth=2)
holdon
plot(sol.x,sol.y(2,:),’g’, LineWidth=2)
holdon
plot(sol.x,sol.y(3,:),Linewidth=2)
holdon
plot(sol.x ,sol.y(4,:),Linewidth=2)
holdon
plot(sol.x,sol.y(5,:),Linewidth=2)
holdoff
title(‘SEIQR at equilibrium’);
xlabel (‘time(days)’) ;
ylabel (‘steady state solution’) ;
legend (‘S’,’E’,’I’,’Q’,’R’) ;I am running this MATLAB code but it is giving me illegal use of keyword end, I checked the whole code and it has all brackets closed also, here is code:
%SEIQR model (equilibrium solution with time delay)
S = 2.376543 ;% Initial number of susceptible people in million
E = 2.557000 ;%Number of exposed people in million
I = 0; % Initial number of infected people
Q = 0 ;% Initial quarantined number
R = 0 ;% Initial number of recovered people
r1 = 2.5 ;% average susceptible contact number
r2 = 0.5 ;% average quarantine contact number
alpha=0.922; % infection rate in exposed people
r=0.303; % rate of infection
d1=0; % average natural death rate
d2=0.001; % average covid induced death rate
beta1=0.80; %infection rate per infected person
beta2=0.0701; % infection rate per quarantined person
gamma1= 0.01;% recovery rate in exposed people
gamma2= 0.01;% recovery rate in infected people
gamma3= 0.05;% recovery rate in quarantined people
M=1;
h = 0.01 ;% differential time interval
T = h:h:500 ;
foridx = 1:length(T)-1;
S(idx+1) = S(idx) + h*(M-alpha*S(idx)*E(idx) – d1*S(idx)) ;
E(idx+1) = E(idx) + h*(-alpha*S(idx)*E(idx) – d1*E(idx) – r*E(idx)) ;
I(idx+1) = I(idx) + h*(r*E(idx) -d2*I(idx)-d1*I(idx)-gamma2*I(idx)-beta2*I(idx)) ;
Q(idx+1) = Q(idx) + h*(beta1*E(idx) + beta2*I(idx)-d1*Q(idx)-d2*Q(idx)-gamma1*Q(idx)) ;
R(idx+1) = R(idx) + h*(gamma1*Q(idx)+gamma2*I(idx)+gamma3*E(idx)-d1*R(idx)) ;
end
clear; clc;
beta = 1.9; % contact rate per day
a1 = 0.3; % quarantine rate in exposed people
a2 = 0.2; % quarantine rate in infected people
r=0.303;
gamma1= 0.02;% recovery rate in exposed people
gamma2= 0.02;% recovery rate in infected people
gamma3= 0.09;% recovery rate in quarantined people
mu= 0.06; % natural death rate
beta1=0.8;
beta2=0.0701;
tau =14; %time delay (incubation period)
M=1;
d1 = 0.04;% death rate in infected people
d2 = 0.02;% death rate in quarantined people
ddeSEIQR = @(t,y,Z) [M-beta*y(1)*y(3)-d1*y(1) ;
(beta*y(1)*y(3))-d1*exp(-mu*tau)*Z(2,1)-r*y(2)-gamma3*y(2)-beta1*y(2) ; %Z(2,1) approximates the delay in exposed population
beta*exp(-mu*tau)*Z(2,1)-d2*y(3)-d1*y(3)-gamma2*y(3)-beta2*y(3) ;
beta1*y(2)+beta2*y(3)-d1*y(4)-d2*y(4)-gamma1*y(4) ;
gamma1*y(4)+gamma2*y(3)+gamma3*y(2)-d1*y(5)] ;
sol = dde23(ddeSEIQR,[14,1], [0.99 0 0.01 0 0] , [0 , 100]) ;%dde23 (@. . . . , tau , history ,tspan ;
figure ;
plot(sol.x,sol.y(1,:), ‘r’, LineWidth=2)
holdon
plot(sol.x,sol.y(2,:),’g’, LineWidth=2)
holdon
plot(sol.x,sol.y(3,:),Linewidth=2)
holdon
plot(sol.x ,sol.y(4,:),Linewidth=2)
holdon
plot(sol.x,sol.y(5,:),Linewidth=2)
holdoff
title(‘SEIQR at equilibrium’);
xlabel (‘time(days)’) ;
ylabel (‘steady state solution’) ;
legend (‘S’,’E’,’I’,’Q’,’R’) ; I am running this MATLAB code but it is giving me illegal use of keyword end, I checked the whole code and it has all brackets closed also, here is code:
%SEIQR model (equilibrium solution with time delay)
S = 2.376543 ;% Initial number of susceptible people in million
E = 2.557000 ;%Number of exposed people in million
I = 0; % Initial number of infected people
Q = 0 ;% Initial quarantined number
R = 0 ;% Initial number of recovered people
r1 = 2.5 ;% average susceptible contact number
r2 = 0.5 ;% average quarantine contact number
alpha=0.922; % infection rate in exposed people
r=0.303; % rate of infection
d1=0; % average natural death rate
d2=0.001; % average covid induced death rate
beta1=0.80; %infection rate per infected person
beta2=0.0701; % infection rate per quarantined person
gamma1= 0.01;% recovery rate in exposed people
gamma2= 0.01;% recovery rate in infected people
gamma3= 0.05;% recovery rate in quarantined people
M=1;
h = 0.01 ;% differential time interval
T = h:h:500 ;
foridx = 1:length(T)-1;
S(idx+1) = S(idx) + h*(M-alpha*S(idx)*E(idx) – d1*S(idx)) ;
E(idx+1) = E(idx) + h*(-alpha*S(idx)*E(idx) – d1*E(idx) – r*E(idx)) ;
I(idx+1) = I(idx) + h*(r*E(idx) -d2*I(idx)-d1*I(idx)-gamma2*I(idx)-beta2*I(idx)) ;
Q(idx+1) = Q(idx) + h*(beta1*E(idx) + beta2*I(idx)-d1*Q(idx)-d2*Q(idx)-gamma1*Q(idx)) ;
R(idx+1) = R(idx) + h*(gamma1*Q(idx)+gamma2*I(idx)+gamma3*E(idx)-d1*R(idx)) ;
end
clear; clc;
beta = 1.9; % contact rate per day
a1 = 0.3; % quarantine rate in exposed people
a2 = 0.2; % quarantine rate in infected people
r=0.303;
gamma1= 0.02;% recovery rate in exposed people
gamma2= 0.02;% recovery rate in infected people
gamma3= 0.09;% recovery rate in quarantined people
mu= 0.06; % natural death rate
beta1=0.8;
beta2=0.0701;
tau =14; %time delay (incubation period)
M=1;
d1 = 0.04;% death rate in infected people
d2 = 0.02;% death rate in quarantined people
ddeSEIQR = @(t,y,Z) [M-beta*y(1)*y(3)-d1*y(1) ;
(beta*y(1)*y(3))-d1*exp(-mu*tau)*Z(2,1)-r*y(2)-gamma3*y(2)-beta1*y(2) ; %Z(2,1) approximates the delay in exposed population
beta*exp(-mu*tau)*Z(2,1)-d2*y(3)-d1*y(3)-gamma2*y(3)-beta2*y(3) ;
beta1*y(2)+beta2*y(3)-d1*y(4)-d2*y(4)-gamma1*y(4) ;
gamma1*y(4)+gamma2*y(3)+gamma3*y(2)-d1*y(5)] ;
sol = dde23(ddeSEIQR,[14,1], [0.99 0 0.01 0 0] , [0 , 100]) ;%dde23 (@. . . . , tau , history ,tspan ;
figure ;
plot(sol.x,sol.y(1,:), ‘r’, LineWidth=2)
holdon
plot(sol.x,sol.y(2,:),’g’, LineWidth=2)
holdon
plot(sol.x,sol.y(3,:),Linewidth=2)
holdon
plot(sol.x ,sol.y(4,:),Linewidth=2)
holdon
plot(sol.x,sol.y(5,:),Linewidth=2)
holdoff
title(‘SEIQR at equilibrium’);
xlabel (‘time(days)’) ;
ylabel (‘steady state solution’) ;
legend (‘S’,’E’,’I’,’Q’,’R’) ; end, illegal use MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

Optimal decimation to Log Simulation Data
2025-05-18

Optimal decimation to Log Simulation Data

I need to use a scope to display the current i and the power P as functions of the voltage V, with the curves obtained for various irradiance levels and temperatures
2025-05-18

I need to use a scope to display the current i and the power P as functions of the voltage V, with the curves obtained for various irradiance levels and temperatures

Break in and break away points on Root Locus
2025-05-18

Break in and break away points on Root Locus

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss