... 412
Essential MATLAB for Engineers and Scientists
feet = rem(feet, 3);
disp( [yards feet inches] );
4.5 a = 10;
x=1;
k = input(’How many terms do you want? ’);
forn=1:k
x=a*x/n;
if rem(n, 10) ... C Command and functionquick reference
matlab\ iofun - File input/output.
matlab\ timefun - Time and dates.
matlab\ datatypes - Data types and structures.
matlab\ verctrl - Ve...
... 39 page 206
Essential MATLAB for Engineers and Scientists
e.g.
10
3
=
10!
3!×7!
=
10 ×9 ×8
1 ×2 ×3
.
Using Equation (8.2) is computationally much more efficient:
ncr=1;
n =
r =
for k = 1:r
ncr=ncr*(n-k+1)/k;
end
disp( ... script:
dt = 0.1;
g = 9.8;
u = 60;
213
Ch10-H8417 5/1/2007 11: 40 page 234
Essential MATLAB for Engineers and Scientists
two MATLAB fun...
... page 330
Essential MATLAB for Engineers and Scientists
of times; this is where computer simulation is handy. The following script
simulates spinning a coin 50 times:
for i = 1:50
r = rand;
if ... 41 page 302
Essential MATLAB for Engineers and Scientists
➤
Place an axes component on the GUI. Its HandleVisibility should
be on.
➤
Place a pushbutton (tag pushbutton1) on...
... 5/1/2007 11: 36 page 102
Essential MATLAB for Engineers and Scientists
3.2 Consider the following structure plan, where M and N represent MATLAB
variables:
1. Set M =44 and N =28
2. While M not ... your algorithm, and test it on some equations
for which you know the solutions, e.g.
x +y = 3
2x −y = 3
102
Ch04-H8417 5/1/2007 11: 37 page 112
Essential MATLAB for...
... 124
Essential MATLAB for Engineers and Scientists
−0.4
−15 10 −55 0101 5
0.4
0.6
0.8
1
−0.2
0.2
0
Figure 5.2 sin(x)/x
the zero with eps. This MATLAB function returns the difference between 1.0 and
the ... page 146
Essential MATLAB for Engineers and Scientists
➤ The colon operator is ideal for the sort of row operations performed in
Gauss reduction (a technique o...
... 17.11. From these displacements the internal forces
in the shell (bending moment and normal force) could be determined and used for
designing the reinforcement. The analysis shown here demonstrates ... differential equation for unit values of load and electric field
can be derived using a Radon transformation
4,5
. The fundamental solution in 3-D for
ˆ
U
which combines the di...
...
dynamic arrays and the integration order to be used for the example. Here we use two
files INPUT.DAT and OUTPUT.DAT for input and output. The input file has to be
created by the user before the program ... reading this information, we find the largest node number, information
which we need for allocating the dimension for the array containing node coordinates
and which we...