Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

get a matrix of matrices from a while loop

Status
Not open for further replies.

DC977

Chemical
Joined
Feb 25, 2015
Messages
1
Location
US
pLease see attached file.

I am dealing with percoaltion theory for disease spread. My programme currently randomly immusies a percentage of the population and then infects one of them and the final programme lets the disease spread.

However I want to be able to call different stages of the disease spread from the final programme. I thought of doing this by calling each matrix created after every run in the loop called I_pop and put them into a matrix so i can easily call each partition of that matrix. however I dont know how to return all matrices from my loop and not just the one created at the end.

Also, I need to plot the population at the start and see the progress at the end.
Any help would be appreciated.
if there is any other easier way to handle it, please comment or suggest!
 
 http://files.engineering.com/getfile.aspx?folder=31db9ced-361b-434f-914d-0f1aa0df036a&file=Comp_phys_II_Part2.xmcd
Hi,
Bit late in the day, I know but the attached might be of some help to you. You appear to be on the right track for returning all of the population matrices. As for plotting, it depends on what you want to show.

Excognito
 
 http://files.engineering.com/getfile.aspx?folder=2ea12871-00d5-428e-8a1b-8aea17f4852e&file=Comp_phys_II_Part2.xmcd
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top