admin管理员组文章数量:1794759
MATLAB的dec2bin函数的使用
MATLAB帮助文档解释:function: dec2bin Convert decimal integer to its binary representationusage: dec2bin(D) returns the binary representation of D as a character vector. D must be a non-negative integer. If D is greater than flintmax, dec2bin might not return an exact representation of D. dec2bin(D,N) produces a binary representation with at least N bits.
函数功能: 把一个十进制数转换成一个字符串形式的二进制数。
语法: dec2bin(D) 把十进制数D转换成二进制形式,并存在一个字符串中。 dec2bin(D,N) 把十进制数D转换成二进制形式,并存在一个字符串中。N指定二进制的位数,但是如果返回的二进制位数大于N,则以实际为准。
示例: demo1:
dec2bin(5) 返回‘101’demo2:
dec2bin(5,4) 返回‘0101’demo3:
dec2bin(5,2) 返回‘101’
版权声明:本文标题:MATLAB的dec2bin函数的使用 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686490326a73375.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论