Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Pseudocode

•   console
clear
clear functions & variables
Verhulst growth
… parameters …
assign initial population 0.5
assign birth rate 3.99
assign carrying capacity 1
create population matrix
for year from 1 to 1000
calculate population difference by
end for loop
set graph 0
plot population versus time graph
add legend, label, title, grid
• Plot Pn versus Pn+1
• Either within for loop
plot(p($-1),p($),"og")
• Or creating a new matrix
pnplus1=p
pnplus1(1)=[]
p($)=[]
scf(1)
plot(p,pnplus1,"og")
• Try to create random numbers using rand().
Pseudocode
Differentiate sin(x)
clear console
clear functions & variables
set step size 0.1
set range between –pi to +pi with increment step size
calculate y=sin(x) values
calculate numerical differences
correct the matrix size
divide the differences by step size

set graph 0
plot y in blue
plot z in red
add title, label, legend, grid

You might also like