Biomedical Engineering Reference
In-Depth Information
80
70
60
50
40
30
20
10
0
0
1
2
3
4
5
6
7
8
10
Time (s)
FIGURE A.5 The function y ¼ 210
p e 2 t sin(
p t
) drawn using Microsoft Excel.
A.1.8 Loading, Quitting and Saving the Workspace
Most problems can be solved interactively using MATLAB by entering information on
the command line, pressing Enter, and having MATLAB evaluate the expression. For more
challenging and lengthy projects, one can use m-files to store work to be retrieved later for
further analysis. As a user becomes more proficient in MATLAB, m-files are used more fre-
quently to store MATLAB commands, data, and input-output. The default extension for
MATLAB is .mat. To create an m-file, one can save the workspace, or write the commands
in Windows Notepad and load the commands in MATLAB with the load command. All of
the expressions in the m-file are computed when loaded.
To open an m-file, type
>>
load “filename.mat”
The command “save” is used to save the workspace to an m-file. If no filename is given,
MATLAB defaults to “matlab.mat.”
A.2 SO LVING DIFFERENTIAL EQUATIONS USING MA TLAB
MATLAB provides the Symbolic Math Toolbox for symbolically solving many calculus
and algebraic problems. The Symbolic Math Toolbox is a collection of commands that oper-
ate on functions based on a program called Maple W developed at the University of Waterloo
in Ontario, Canada. Unlike previous exercises in which the answers MATLAB provided
were numbers, using this toolbox results in answers that are symbolic functions. Examples
of symbolic functions are
Z
d
dt
2
2
y Þ e 2 y dy
¼ e 2 t :
tan (
t
Þ
,
(4
y
þ
2
y þ
4
Þ
,
sin (
,
and 4
y þ
2
y þ
6
Search WWH ::




Custom Search