Question: Please answer in Matlab What did I do wrong? Create a function that projects population based on static: Birth Rate (BR) Death Rate (DR) Migration

Please answer in Matlab

What did I do wrong?
Create a function that projects population based on static: Birth Rate (BR) Death Rate (DR) Migration will be represented as a pulse function starting at timestartM, ending at timeEnd and having magnitude Mann. A template for the function has been provided. Please do not change variable names as this will result in an incorrect answer. Function 1 function [P,M)= popDynamics_2_fon( BR, DR, tinit,tfinal, delt, Pinit,Mann, timeStartM, timeEndM ) 2% 3 Case 2. M(t) is a rectangular pulse. Find P(t) history. 4 % SETUP 5 tinit, tfinal, delt time initial, final, & timestep 6 % BR, birth rate 7 % DR. death rate 8 Pinit, initial population level 9 Mann, annual rate of migration (+: immigration, -: emigration) timeStart, time at which migration begins 1 % timeEndM time at wich migration stops MATLAB Editor to write your solution. 3 RESULTS change focus out of the editor, press ti population history Escape Key. Then press Tab to move to 5 M migration history next field, Shift-Tab to move to the pre 6 P(1) - Pinit; field, or Enter to return to the MATLAB 7 M(1) = 0; 8 t = tinit:delt:tfinal 9 for i=1: length(t) - 1 if t(i) > timeEndM t(i)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
