uf_deblank.m

来自「信号实验常用的simulink模型和mfile,可直接在matlan下运行。」· M 代码 · 共 21 行

M
21
字号
function s1 = uf_deblank(s)
% UF_DEBLANK Remove all blanks in the string.
%   UF_DEBLANK(S) removes blanks from string S.
%
%   UF_DEBLANK(C), when C is a cell array of strings, removes the 
%   blanks from each element of C.
%
%   DEBLANK was modified by axz

if ~isempty(s) & ~isstr(s)
    warning('Input must be a string.')
end

if isempty(s)
    s1 = s([]);
else
  % remove ALL blanks
  [r,c] = find ( s >= char(33) & s <= char(126) ) ;
  s1 = s(:,c);
end

⌨️ 快捷键说明

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