MATLAB 도움말 센터
Perform sign function (signum function) on array
c = sign(a)
c = sign(a) returns an array c the same size as a, where each element of c is:
c
a
1 if the corresponding element of a is greater than 0.
1
0
0 if the corresponding element of a is 0.
-1 if the corresponding element of a is less than 0.
-1
The elements of c are of data type int8.
int8
example
collapse all
Find the sign function of a fi object.
fi
sign(fi(2))
ans = int8 1
Find the sign function of a signed fi vector.
v = fi([-11 0 1.5],1); sign(v)
ans = 1×3 int8 row vector -1 0 1
Find the sign function of an unsigned fi vector.
u = fi([-11 0 1.5],0); sign(u)
ans = 1×3 int8 row vector 0 0 1
Input array, specified as a fi scalar, vector, matrix, or multidimensional array.
sign does not support complex fi inputs.
sign
Data Types: fi
expand all
Introduced before R2006a
abs | complex | conj
abs
complex
conj
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
유럽
아시아 태평양
지역별 지사에 문의