No BSD License
-
Zi =filteric(B,A,X,Y)
-
acosd(alpha)
ACOSD arc cos, in degrees, of the elements of alpha.
-
ayrton(range, amp, resist)
AYRTON calculates resistances for an Ayrton multirange ammeter.
-
bending1(s, d, F1, F2)
BENDING1 bending moments caused vehicle moving on beam.
-
conic(phi, param)
CONIC.M generates a conic section whose equation is given in polar form.
-
dcmot(t,om);
this function represents the model of a DC motor
-
dervabk(t,x);
this function returns the derivatives of the unit feedback system
-
divide(x, y)
-
eulangle(psi, theta, phi)
EULANGLE matrix of rotations by Euler's angles.
-
evalpol2(c, x)
EVALPOL2 Polynomial evaluation by Horner's scheme.
-
fact(x)
FACT factorial by a recursive procedure.
-
gcd1(x, y, tol)
-
gcd2(x, y)
GCD2 greatest common divisor by a recursive procedure.
-
pend(t,w);
This m-file describes the motion of a pendulum subject to gravity,
-
pliny(t,h);
This function respresents the model of the Pliny's intermittent fountain
-
rndprm1(X);
RNDPRM1 random permutation of row vector using FOR loop.
-
rndprm2(X);
RNDPRM2 random permutation of row vector using WHILE loop.
-
rndprm3(X);
RNDPRM3 random permutation of row vector using recursion.
-
rtate(theta)
RTATE(THETA) rotates theta degrees counterclockwise
-
scale(alpha, beta)
SCALE scaling matrix.
-
segment(A,r)
SEGMENT angle subtended by a circular segment.
-
segment1(A,r)
SEGMENT1 angle of circular segment, plot of iterations.
-
simp(x, y)
SIMP(X, Y) Simpson integration of tabular data y(x).
-
sind(alpha)
-
sind(alpha)
COSD(ALPHA) cosine of the elements of ALPHA, angle measured in degrees.
-
spipe(Re)
LAMBDA smooth-pipe frictional coefficient.
-
tankv(M, V0, tol)
TANKV(M, V0, tol) tank volume by iterative method
-
trlate(dx, dy)
-
uramp(t, t0)
URAMP(t, t0) unit ramp function beginning at t0.
-
ustep(t, t0)
-
vprod(A, B)
-
wd =doga(t,w);
This function represents the model of the dog chasing problem,
-
wd =dogb(t,w);
This function represents the model of the dog chasing problem,
-
wd=derv2a(t,w);
example of linear differential equation
-
wd=derv2b(t,w);
example of linear differential equation
-
wd=derv3a(t,w);
example of linear differential equation
-
wd=derv3b(t,w);
example of linear differential equation
-
wd=invp(t,w);
inverted pendulum on a cart.
-
wd=spring(t,w);
This function defines the differential equation relative to
-
wd=stiff(t,w);
This function defines the differential equation of a stiff system
-
xd=cspring(t,x);
This function defines the spring system. It is written in the format
-
alias.m
-
atmpres.m
-
bolind1.m
-
br1.m
-
br2.m
-
br3.m
-
ch14ex10.m
-
ch14ex12.m
-
ch14ex2a.m
-
ch14ex2b.m
-
ch14ex3a.m
-
ch14ex3b.m
-
ch14ex4a.m
-
ch14ex4b.m
-
ch14ex7.m
-
ch15ex11.m
-
ch15ex14.m
-
ch15ex16.m
-
ch15ex3.m
-
ch15ex5.m
-
ch15ex7.m
-
ch15ex8.m
-
ch15ex9.m
-
ch16ex10.m
-
ch16ex12.m
-
ch16ex2.m
-
ch16ex3.m
-
ch16ex7.m
-
complext.m
-
crane.m
-
diode.m
-
door.m
-
evalpol.m
-
evalpol1.m
-
exa2_05.m
-
exa3_05.m
-
exa3_06.m
-
exam04_1.m
-
exam09_2.m
-
exam09_3.m
-
exe10_02.m
-
exe10_06.m
-
exe10_09.m
-
exe11_12.m
-
exe11_13.m
-
exe17_04.m
-
exer2_03.m
-
exer2_04.m
-
exer2_06.m
-
exer2_09.m
-
exer2_11.m
-
exer3_03.m
-
exer3_07.m
-
exer3_10.m
-
exer3_13.m
-
exer3_14.m
-
exer4_05.m
-
exer4_06.m
-
exer4_10.m
-
exer5_07.m
-
exer6_05.m
-
exer6_06.m
-
exer6_08.m
-
exer7_03.m
-
exer8_02.m
-
exer8_05.m
-
exer9_05.m
-
exer9_11.m
-
fig04_06.m
-
fig04_09.m
-
fig05_08.m
-
fig06_01.m
-
fig06_02.m
-
fig10_03.m
-
fig10_04.m
-
fig10_12.m
-
fig11_01.m
-
fig11_02.m
-
fig1_11.m
-
fndwmal.m
-
hello.m
-
hi_lo.m
-
itermenu.m
-
kvisc.m
-
newton.m
-
ospring.m
-
pipe.m
-
raphson.m
-
rectify.m
-
rod1.m
-
rod2.m
-
s_couple.m
-
scissor.m
-
supsteam.m
-
turbot.m
-
ultim.m
-
vecrot.m
-
yellow.m
-
yellow1.m
-
View all files
|
|
| gcd2(x, y) |
function z = gcd2(x, y)
%GCD2 greatest common divisor by a recursive procedure.
% GCD2(x, y) recursive greatest common divisor of reals
% x and y evaluated with the precision tol. If the third
% argument is not specified, tol = 1.0E-4.
if nargin == 2
tol = 1.0E-4;
end
if tol <= 0
error('Argument tol must be strictly positive')
end
if (sum(size(x)) ~=2)&(sum(size(y))) ~= 2
error('Arguments are not scalars, calculation aborted')
end
if x < 0
x = -x;
end
if y < 0
y = -y;
end
if y <= tol
z = x;
else
z = gcd2(y, rem(x, y));
end
|
|
Contact us at files@mathworks.com