I don't understand what this means or how to do it

조회 수: 2 (최근 30일)
Coby Juarez
Coby Juarez 2021년 10월 16일
I've been given an assignment in this class where I have to simulate a population while a sickness is spreading. I represents the immune, S represents the sick, and W represents the well. You input the amount of days you'd like to pass as well as the initial population values of the different groups and it returns the new population values as a percentage of the whole population after that many days. My function works fine and is shown below.
function [popPerc] = PercPopAfterT(t,I0,S0,W0)
Population = [I0 S0 W0];
for day = 1:t
I=Population(1,1)+.12*Population(1,2)-.01*Population(1,1);
S=Population(1,2)+.08*Population(1,3)-.04*Population(1,2)-.02*Population(1,2)-.12*Population(1,2);
W=Population(1,3)+.06*Population(1,3)+.02*Population(1,2)-.02*Population(1,3)-.08*Population(1,3)+.03*Population(1,1);
Population=[round(I) round(S) round(W)];
end
popPerc = 100*(Population/sum(Population, 'all'));
The next question is: "Using the PercPopAfterT function, find the long-term equilibrium population percentages." Does anyone know what this question is asking me and how I would go about solving this. I'm lost and it's gonna be due soon.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by