R MATLAB Operation
log(X) log(X) Natural log of X
...................................................................................................................................................
matrix(0,n) zeros(n) Column matrix of n
zeros
...................................................................................................................................................
matrix(0,n1,n2) zeros(n1,n2) n1 x n2 matrix of zeros
...................................................................................................................................................
max(X) max(X) Maximum of values in X
...................................................................................................................................................
mean(X) mean(X) Mean of values in X
...................................................................................................................................................
min(X) min(X) Minimum of values in X
...................................................................................................................................................
mvrnorm(n=, mu=,
Sigma= )
mvnrnd(MU,SIGMA) Random multivariate
normal deviates
...................................................................................................................................................
nlm, optimize fminsearch, fminbnd Non-linear
optimization
...................................................................................................................................................
ncol(X) size(X,2) Nos of columns in X
...................................................................................................................................................
nrow(X) size(X,1) Nos of rows in X
...................................................................................................................................................
order(X) [C,I]=max(X) Get indexes of X that
indicate sort
structure
...................................................................................................................................................
outer(x, y, FUNC=) na All combinations of x
and y applying
FUNC=function
...................................................................................................................................................
par(mfcol=c
(1,2))
subplot(2,1,1) Divide graphics page in
two
...................................................................................................................................................
par(mfrow=c
(2,2))
subplot(2,2,2) ivide graphics page
into quadrats
...................................................................................................................................................
persp(x, y, z.
matrix)
surfc(x, y, zmatrix) 3D plot
...................................................................................................................................................
plot(x,y,
optional
parameters)
plot, ezplot, fplot 2D plot
...................................................................................................................................................
pnorm(x, mean=,
sd= )
1−normcdf(X,mu,
sigma)
Integral from x to
infinity of normal
distribution
...................................................................................................................................................
points(x, y) hold on plot(x,y,´:´) Plot points on an
existing plot
...................................................................................................................................................
print(X) X Print X
...................................................................................................................................................
print(c(x1, x2,
x3))
[x1, x2, x3] Print x1, x2, x3
...................................................................................................................................................
qnorm(P, mean=,
sd= )
na normal distribution
function
...................................................................................................................................................
read.table
(file=“Filename.
txt”)
load Filename.txt Read data from text
file
...................................................................................................................................................
(continued)
APPENDIX 1 425