Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (caozeyuan):

Help on my Matlab exercise: Write a while loop that outputs the answer to the following question: Sally prepares two plates of 10 cells each. One plate has normal cells, and the other contains cells with a mutation believed to reduce the normal reproduction rate by half. If the number of normal cells triples every hour, how many of each type of cell should be in the plates after 12 hours

OpenStudy (kva1992):

int hour,regularCell,mutatedCell; (java code) while (hour < 13) { regularCell = i +3; muatedCell = regularCell /2; hour++; } (visual basic code) While hour < 13 regularCell += 3 MutatedCell = regularCell / 2 hour += 1 Exit While End While if i am not mistaken that is how it should be set up

OpenStudy (caozeyuan):

Thanks I kind of get the idea, but I still not sure how to right it in Matlab, cuz I think the coding system is different from the one you described

OpenStudy (kva1992):

well first thing i would do is figure out how what their coding system is in order to write the loop

OpenStudy (mathmate):

@caozeyuan The syntax of the while loop is while( condition ) do whatever you need to do end The pseudocode for what you need to do is: 1. Set both Normal and Mutated to 10, and time to zero (initial conditions). 2. While ( time<13 ) do 3. print time, Normal, Mutated 4. Mutated <- Mutated * 3 % multiplication by three, exponential growth. 5. Normal <- Normal * 3/2 % rate is half of normal 6. time <- time + 1 7. end Run your code and post if you have problems.

OpenStudy (mathmate):

*The syntax of the while loop is while( condition ) whatever you need to do end ("do" is not required after "while")

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!