카테고리 없음2016. 6. 24. 14:28

Syntax

C = bsxfun(fun,A,B)

Description

C = bsxfun(fun,A,B) applies the element-by-element binary operation specified by the function handle fun to arrays A and B, with singleton expansion enabled. fun can be one of the following built-in functions:

@plus

Plus

@minus

Minus

@times

Array multiply

@rdivide

Right array divide

@ldivide

Left array divide

@power

Array power

@max

Binary maximum

@min

Binary minimum

@rem

Remainder after division

@mod

Modulus after division

@atan2

Four-quadrant inverse tangent; result in radians

@atan2d

Four-quadrant inverse tangent; result in degrees

@hypot

Square root of sum of squares

@eq

Equal

@ne

Not equal

@lt

Less than

@le

Less than or equal to

@gt

Greater than

@ge

Greater than or equal to

@and

Element-wise logical AND

@or

Element-wise logical OR

@xor

Logical exclusive OR


fun = @(A,B) A.*sin(B);
A = 1:7;
B = pi*[0 1/4 1/3 1/2 2/3 3/4 1].';
C = bsxfun(fun,A,B)


Posted by 오늘보다 나은 내일