Type | Fortran90 | MatLab | Description |
---|---|---|---|
A | ABS(A) | abs(a) | Absolute value of A |
R | ACOS(X) | acos(x) | Arc cosine of real X |
R | AIMAG(Z) | imag(z) | Imaginary part of complex number |
R | AINT(X) | real(fix(x)) | Truncate (fractional real) X to a real whole number |
R | ANINT(X) | real(round(x)) | Round (fractional real) X to a real whole number |
R | ASIN(X) | asin(x) | Arcsine of real X |
R | ATAN(X) | atan(x) | Arctangent of real X |
R | ATAN2(Y,X) | atan2(y,x) | Arctangent of complex number (X,Y) |
I | CEILING(X) | ceil(x) | Least integer that is >= X |
Z | CMPLX(X,Y) | (x+yi) | Compose 2 reals into 1 complex number |
Z | CONJG(Z) | conj(z) | Conjugate of complex number Z |
R | COS(X) | cos(x) | Cosine of real X |
R | COSH(X) | cosh(x) | Hyperbolic cosine of real X |
R | DOT_PRODUCT(X,Y) | x'*y | Dot product of vectors X and Y |
R,Z | EXP(XZ) | exp(xz) | Exponential of real or complex number |
I | FLOOR(X) | floor(x) | Greatest integer that is <= X |
R | HUGE(X) | realmax | Value of the largest possible real number |
I | INT(A) | int(a) | Convert A to integer |
R | LOG(XZ) | log(xz) | Natural logarithm of real or complex number XZ |
R | LOG10(XZ) | log10(xz) | Base 10 logarithm of real or complex number XZ |
Array | MATMUL(X,Y) | x*y | Conformable matrix multiplication X*Y |
I | MAXLOC(X) | [y,i]=max(x) | Location of the maximum array element |
R | MAXVAL(X) | y=max(x) | Value of the maximum array element |
I | MINLOC(X) | [y,i]=min(x) | Location of the minimum array element |
R | MINVAL(X) | y=min(x) | Value of the minimum array element |
I | NINT(X) | round(x) | Round (fractional real) X to an integer whole number |
CALL | RANDOM_NUMBER(X) | x=rand | Psuedo random number in (0,1) |
CALL | RANDOM_SEED | rand('seed') | Initialize Psuedo random number generator |
R | REAL(A) | real(a) | Convert a variable A to real |
Array | RESHAPE(X, (/I1,I2/) | reshape(x,i1,i2) | Reshape array X into matrix I1x12 |
Int Array | SHAPE(X) | size(x) | Array shape vector |
R | SIGN(X,Y) | Abs(X)*Sign(Y) | |
R | SIGN(0.5,X) - SIGN(0.5,-X) | sign(x) | -1 if X <0, 0 or 1 if X > 0 |
RZ | SIN(XZ) | sin(xz) | Sine function of real or complex XZ |
R | SINH(XZ) | sinh(xz) | Hyperbolic sine function of real or complex XZ |
I | SIZE(X) | length(x) | Number of elements in array X |
RZ | SQRT(XZ) | sqrt(xz) | Square root of real or complex number |
R | SUM(X) | sun(x) | Sum of all elements in array X |
Do NOT use a variable name that collide with an intrinsic function !!! |