Lauren M. Magee Week 3

From OpenWetWare
Revision as of 11:44, 29 January 2015 by Lauren M. Magee (talk | contribs) (MatLab Assingment Structure)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

MATLAB Skills Development

  • Part I: Create a script that includes the following elements
    • Define a vector u containing the elements 1,2,3,4,5,6,7,8,9,10 using the colon operation
    • Define another vector v containing elements that are the square of the vector x
    • Plot v versus u (make sure you know what that sentence means!!) using circles on the points that are connected with dashed lines
    • Save your plot as a TIFF file
    • Save your data into an excel spreadsheet using the MATLAB command xlswrite
  • Part II: Use MATLAB to solve the equation ln(x) + x = 0. The following steps will help.
    • Create a function that returns ln(x) + x; its first line should be this: function [y] = logPlusX(x)
    • Create a script that uses the MATLAB function fsolve to solve the equation. This script may be short.
  • Part III: Play with the four m-files from the Thursday Jan 22 schedule box.
    • Run the nutrient/colony model
    • Run the chemostat model
    • Save the graphical output from these two runs to JPEG files.
    • Run the chemostat model a second time, but cut the dilution rate in half
    • Plot both chemostat model runs on the same graph, adding a legend that allows a reader to identity both runs, and save as JPEG.