Scilab 5.3.3
      
      
    Please note that the recommended version of Scilab is 2026.0.0. This page might be outdated.
See the recommended documentation of this function
dec2bin
2進表現
呼び出し手順
[str]=dec2bin(x[,n])
パラメータ
- x
- 正の整数のスカラー/ベクトル/行列 
- n
- 正の整数 
- str
- 文字列または文字列のベクトル 
説明
正の整数(または整数のベクトル/行列)
	xを指定すると,
	この関数は,
	xの2進数表現を含む
	文字列(または文字列の列ベクトル)を返します.
	xの次元が1より大きい場合,
	列ベクトルstrの各要素が
	xの要素の2進表現となります
	(すなわち,str(i)が
    	x(i)の2進表現).
	strの要素の長さがn
	より小さい場合 (すなわち, length str(i) < n),
	str要素の左側に,長さが
	n.等しくなる分の文字 '0'を
	str要素の左側に追加します.
例
// 例 1 : x=86; str=dec2bin(x) // 例 2 : // 86 の2進表現は : '1010110' // 長さは7 (n以下)のため, str(の左側)に'0'が8個追加されます x=86;n=15; str=dec2bin(x,n) // 例 3 : x=[12;45;135] z=dec2bin(x)
参照
| << bin2dec | Integer representation | dec2hex >> |