an introduction to matlab - uclaan introduction to matlab day 3 simon mitchell...
TRANSCRIPT
![Page 2: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/2.jpg)
Day 2:∗ While loops∗ Break statements∗ Vectors∗ Higher dimensional matrices∗ Sorting∗ Cell Arrays∗ Functions∗ File input and output
![Page 3: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/3.jpg)
Plotting
![Page 4: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/4.jpg)
Plotting
[-100:STEPSIZE:100]
![Page 5: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/5.jpg)
Plotting
xlabel(STRING); ylabel(STRING); title(STRING); grid on; axis equal;
![Page 6: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/6.jpg)
Plotting Multiple Graphs
hold on;
![Page 7: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/7.jpg)
Plotting Multiple Graphs
hold on;
![Page 8: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/8.jpg)
Changing the renderer
hold on;
![Page 9: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/9.jpg)
Setting Axis Scales
>> axis([xLow xHigh yLow yHigh]);
![Page 10: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/10.jpg)
SubPlots
>> subplot(n,m,p);Plot n x m grid of plots and choose plot p.
![Page 11: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/11.jpg)
Legend location
![Page 12: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/12.jpg)
Legend location
![Page 13: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/13.jpg)
Bar Graphs
![Page 14: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/14.jpg)
Bar Graphs
![Page 15: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/15.jpg)
3 Dimensional Plots
Meshgridgenerates all possible x and y coordinates in a range
![Page 16: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/16.jpg)
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.
![Page 17: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/17.jpg)
Solving Equations
solve(equations, variable)
![Page 18: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/18.jpg)
Systems Biology Modeling
Simulated biochemical systems using MATLAB• Test and generate hypotheses• Fewer and better experiments• Mechanistic explanation for results!• Accessible• Translational
![Page 19: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/19.jpg)
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
![Page 20: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/20.jpg)
Systems Biology Modeling
What is the rate of change of A?
R1A
B
A
BAB
![Page 21: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/21.jpg)
Systems Biology Modeling
What is the rate of change of A?
R1A
B
A
BAB
![Page 22: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/22.jpg)
R1A
B
AB
AB
![Page 23: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/23.jpg)
R1A
B
AB
AB
![Page 24: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/24.jpg)
R1A
B
AB
AB
![Page 25: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/25.jpg)
R1A
B
AB
ABC
R2
![Page 26: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/26.jpg)
R1A
B
AB
ABC
R2
![Page 27: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/27.jpg)
Debugging
Breakpoints
![Page 28: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/28.jpg)
Breakpoints
BreakpointsHover over variables to view their contents
Step through line by line
Arrow indicates position in the code
![Page 29: An Introduction to MATLAB - UCLAAn Introduction to MATLAB Day 3 Simon Mitchell Simon.Mitchell@ucla.edu. Day 2: ∗ While loops ∗ Break statements ∗ Vectors ∗ Higher dimensional](https://reader030.vdocuments.us/reader030/viewer/2022040307/5ed322f8f1dee620f72fda5a/html5/thumbnails/29.jpg)
Combining Everything!
R1A
B
AB
ABC
R2