Post on 28-May-2020
An Introduction to MATLABDay 3
Simon MitchellSimon.Mitchell@ucla.edu
Day 2:∗ While loops∗ Break statements∗ Vectors∗ Higher dimensional matrices∗ Sorting∗ Cell Arrays∗ Functions∗ File input and output
Plotting
Plotting
[-100:STEPSIZE:100]
Plotting
xlabel(STRING); ylabel(STRING); title(STRING); grid on; axis equal;
Plotting Multiple Graphs
hold on;
Plotting Multiple Graphs
hold on;
Changing the renderer
hold on;
Setting Axis Scales
>> axis([xLow xHigh yLow yHigh]);
SubPlots
>> subplot(n,m,p);Plot n x m grid of plots and choose plot p.
Legend location
Legend location
Bar Graphs
Bar Graphs
3 Dimensional Plots
Meshgridgenerates all possible x and y coordinates in a range
Editing plots
There is much, much more to learn about editing and formatting plots.
Play with the ‘property editor’Anything you can do in the property editor you can do with code.
Solving Equations
solve(equations, variable)
Systems Biology Modeling
Simulated biochemical systems using MATLAB• Test and generate hypotheses• Fewer and better experiments• Mechanistic explanation for results!• Accessible• Translational
Systems Biology Modeling
What is the rate of change of A?
The rate of change of A is equal to the rate of reaction R1
R1
What is the rate of reaction R1 proportional to?
A
B
A
BAB
Systems Biology Modeling
What is the rate of change of A?
R1A
B
A
BAB
Systems Biology Modeling
What is the rate of change of A?
R1A
B
A
BAB
R1A
B
AB
AB
R1A
B
AB
AB
R1A
B
AB
AB
R1A
B
AB
ABC
R2
R1A
B
AB
ABC
R2
Debugging
Breakpoints
Breakpoints
BreakpointsHover over variables to view their contents
Step through line by line
Arrow indicates position in the code
Combining Everything!
R1A
B
AB
ABC
R2
Continued Learning - Thanks
Selling out:
http://www.mathworks.com/molerSimon.Mitchell@ucla.edu