⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 writebin.m

📁 这是一个关于MATLAB的函数
💻 M
字号:
function dummy = writebin(mm,index,data)
%   Copyright 2002 The MathWorks, Inc.
%   $Revision: 1.1 $  $Date: 2002/05/15 21:08:01 $

error(nargchk(2,3,nargin));
if ~ishandle(mm),
    error('First Parameter must be a RNUMERIC Handle.');
end
if nargin==2,   
    data = index;
elseif nargin==3 & isempty(index)
    index = 1;
end

% convert strings/cell array into hexadecimal
if ischar(data),   % Data is a cell array of hexidecimal (value sized)
    try 
        data = bin2dec(data);
    catch
        error('DATA must contain valid binary characters ');        
    end
elseif iscellstr(data)
    msize = size(data);
    try
        data = [bin2dec(data)];
    catch
        error('DATA must contain valid binary characters ');
    end
    if length(msize)==1
        data = reshape(data,1,msize);
    else
        data = reshape(data,msize);
    end
else
    error('DATA must be a binary string or a cell array of binary strings');
end

if nargin == 2,
    write_rnumerichex(mm,data);
else % index version - one value only!
    write_rnumerichex(mm,index,data);
end

% [EOF] writebin.m

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -