도움말 센터도움말 센터
숫자를 문자형 배열로 변환
s = num2str(A)
s = num2str(A,precision)
s = num2str(A,formatSpec)
예제
s = num2str(A)는 fi 객체 A를 문자형 배열 표현으로 변환합니다. eval(s)가 원래 fi 객체를 정확히 생성할 수 있도록 출력값은 eval 함수에 대한 입력값으로 적합해야 합니다.
s
A
fi
eval(s)
eval
s = num2str(A,precision)은 fi 객체 A를 precision에 지정된 정밀도 자릿수를 사용하여 문자형 배열 표현으로 변환합니다.
precision
s = num2str(A,formatSpec)은 formatSpec에 의해 지정된 형식을 A의 모든 요소에 적용합니다.
formatSpec
모두 축소
fi 객체 A를 생성하고 이를 문자형 벡터로 변환합니다.
A = fi(pi)
A = 3.1416 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 16 FractionLength: 13
S = num2str(A)
S = '3.1416'
fi 객체를 생성하고 이를 8자리 정밀도를 가진 문자형 벡터로 변환합니다.
S = num2str(A,8)
S = '3.1416016'
입력 배열로, 숫자형 배열로 지정됩니다.
데이터형: fi | double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical 복소수 지원 여부: 예
double
single
int8
int16
int32
int64
uint8
uint16
uint32
uint64
logical
출력 문자열의 최대 유효 자릿수로, 양의 정수로 지정됩니다.
데이터형: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
출력 필드의 형식으로, 형식 지정 연산자를 사용하여 지정됩니다. formatSpec은 일반 텍스트와 특수 문자도 포함할 수 있습니다.
형식 지정 연산자에 대한 자세한 내용은 MATLAB® 문서의 num2str 함수 도움말 페이지를 참조하십시오.
num2str
입력 배열의 텍스트 표현으로, 문자형 배열로 반환됩니다.
R2016a에 개발됨
num2str | mat2str | tostring
mat2str
tostring
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office