vprime), and the value (above we use volume) and
the name of the function (watertank in the
example), but we can not change the order in which
t and value are given inside the brackets. Solving the
equation is now simple. 7) In the command window
type tim
temperatures by typing plot(date, maxtemp) The xaxis variable is listed first. This graph will be created
in a window called Figure No. 1. If this window is
not visible select Figure No. 1 under Window on the
menu. Your graph should look like the one belo
has its own workspace in memory. This workspace is
different from the workspace used by the Command
Window and script files. In the discussion below we
will use the abbreviation CW for the command
window and talk about 'CW's workspace' instead of
'CW and
variable called 'tf'. The return statement indicates
the end of the function and asks MATLAB to return
to the place from which the function was called. You
can call functions from the command window of
course, or from script files, or even from other
func
equal to 3 in the second pass and equal to 10 in the
third pass. MATLAB loops k over all elements of the
vector [1, 3, 10]. Intermediate elements in sq are set
to 0 by MATLAB. 2) Replace [1, 3, 10] by [4, 2, 9] in
the script file, type clear sq and run th
initialized the variable maxval to 0 at the start of our
program? 17 Section 13 Nested for-loops Just as
we can have if-statements inside for-loops we can
have for-loops inside for-loops. We compute the
exponential of each element of a 2x2 matrix A. A =
r
variables are known as len, br and dep. So length in
CW's workspace corresponds to len in cuboid's
workspace. The values of length and len are the
same. Similarly, breadth corresponds to br and
depth to dep. The output variable vol in cuboid's
workspace c
he dared not breathe. Moonlight shone down on
the clearing, the ashes of the fire pit, the snowcovered lean-to, the great rock, the little halffrozen
stream. Everything was just as it had been a few
hours ago. They were gone. All the bodies were
gone. God
a vector (or matrix): the 'element-by-element
method'. Instead of the for-loop we can write sqv =
v.*v; 1) In the Command Window type v=rand(10,1);
to create a random vector v with 10 elements,
followed by sqv=v.*v . Check that sqv contains the
correct va
might say that discrete data points should not be
joined with lines because, for example, 'maximum
temperature on the twelfth-and-a-half day in
December' is not a meaningful statement. 7) Click
on the graph corresponding to the maximum
temperature. Then s
standing invidious likely to provoke ill will irascible
easily angered irresolute unsure of how to act; weak
itinerant wandering from place to place; unsettled
itinerary route of a traveler's journey jaundiced
having a yellowish discoloration of the skin;
be used in each of the workspaces to stand for two
different variables. 3) To test this, type temp = [1, 2];
in the command window to create a variable called
temp in the command windows workspace. Then
type tempc = fahtocel(tempf) to run the program
agai
you see why? Section 15 - Advanced matrix and
vector operations In many engineering applications
we need to solve matrix-vector equations. This is
very easy in MATLAB, as MATLAB was especially
designed for matrices. In this section we look at
some matrix
while x > 0 x = x-4; disp(x); end; disp('Done'); How
does it work? 1. The variable x is equal to 7 initially.
2. Since x > 0 MATLAB enters the body of the while
loop and subtracts 4 from x, which is now equal to
3. MATLAB displays the new value of x. 3. M
complain that matrix dimensions in the
multiplication operation of cuboid do not agree. We
can solve this by using the element-by-element
operations instead. These are created simply by
inserting a dot before the operation symbol. For
example, vol = len.*
element of x that is larger than the corresponding
element of y. For example, if x = [0.1, 0.11, 0.05, 0.8,
0.91] and y = [0.83, 0.64, 0.09, 0.42, 0.5], you should
find that the required index is 4, because x(4) > y(4)
but the first three elements of x ar
descriptive name, we rename it to 'quartic'. 1)
Without looking at the example below try writing
the function quartic yourself. Now check your
function and save it. It should look like function
y=quartic(x) 30 y= 2*x.^4 + 3*x.^3 - 12*x.^2 - 7*x
+2; return
program: % clear the figure window clf; % create a
sphere using 10 points [x,y,z]=sphere(10); % create a
first plot surf(x,y,z); % initialize a movie with 19
frames M=moviein(19); % fill the frames for j=1:19,
% compute the x-position of the sphere in thi
observation or experiment emulate to imitate; copy
encomium a formal expression of praise endemic
inherent; belonging to an area enervate to weaken
engender to cause; produce enhance to increase;
improve entomology the scientific study of insects
enunciat
gauche coarse and uncouth; clumsy geniality
cheerfulness; kindliness; sociability gerrymander to
divide an area into voting districts in a way that
favors a political party glib fluent in an insincere
way; offhand goad to prod; urge on gossamer sheer;
lig
surf(sampleplot); to create a 3-D surface plot of
these function values. A three-dimensional plot is
shown in the figure window. The axes are the x-, yand z-axis. The z-axis is in the vertical. The colours
vary with the value of z. The colour scheme used
Other function-functions are, for example, fzero
which finds the value of x at which the function
value is equal to zero, and quad which can be used
to compute integrals. The last example For our last
example we will solve a simple ordinary differential
e
arUnit 2 Study Guide - 2.1, 2.2, and 2.4
2.1
Identify the function and location or importance of the following terms:
Central nervous system
Peripheral nervous system
Cerebrum
Lobe
Cerebellum
Brainstem
Gyrus (gyri)
Sulcus (sulci)
Frontal lobe
Motor cortex