Вы находитесь на странице: 1из 2

OPS

zeros(2)
creates a matrix of 2x2, with all elements zero.
zeros(2,3)
creates a matrix of 2x3, with all elements zero.
zeros(1,2,3,4)
creats a 1x2 matrix, with all elements zero. the no of matrix formed will be
3x4=12
with set such as (1,1) (1,2)(1,3).. (2,1)(2,2)(2,3)..............(4,1)(4,2)(4,3)

A/B
division of A by B
A\B
division of B by A
A.\B
Scalar division
^
If A is a matrix. then A square is A^2.

Examples
a = int32([-2 2]);
b = int32(3);
idivide(a,b) returns [0 0]

( rounded to nearest zero)

idivide(a,b,'floor') returns [-1 0]


idivide(a,b,'ceil') returns [0 1]
idivide(a,b,'round') returns [-1 1]
exact middle, rounds to +ve infinity

(rounded to negative infinity)


(rounded to positive infinity)
(rounded to nearest integer).. if in

whille using integer functions such as int8, int32. if over flow occours, it will
display the last limit.
int8(1234)
A'

- it will display 127..

This finds the transpose of matrix A.

eq

- Equal

ne

- Not equal

lt

==

- Less than

gt

- Greater than

le

- Less than or equal

ge

~=
<

- Greater than or equal

>
<=
>=

example
A=[2,3] & B=[2,5]
A~=B
o/p= [0,1]

if we perforn A&B

-- o/p= [1,1]

if a is a matrix, perform all(a), if any of the element is zero, the o/p will be 0,
else o/p will be 1 if all elements are non zero.

if A is a matrix - if we perform all(A) or all(A,1) - it will perform all operation


column wise & o/p is displayed in row format, if we perform all(A,2) - it will
perform all operation row wise & o/p is displayed in column format.
similar functions as above are any(a)

Вам также может понравиться