isfdt.m

来自「有关matlab的电子书籍有一定的帮助希望有用」· M 代码 · 共 35 行

M
35
字号
function flag = isfdt(fdt)
%ISFDT  Check whether input is a Filter Design Tool specification structure.
%       isfdt(x) returns 1 is x is a scalar structure which 
%       matches the specifications structure of the filter design tool
%       of the signal processing toolbox.  It returns 0 otherwise.
 
%   Copyright (c) 1988-98 by The MathWorks, Inc.
% $Revision: 1.5 $

    flag = 1;

    if ~isstruct(fdt)
        flag = 0;
        return
    end

    f = fieldnames(fdt);

    if ~any(strcmp(f,'type'))|...
       ~any(strcmp(f,'method'))|...
       ~any(strcmp(f,'f'))|...
       ~any(strcmp(f,'Rp'))|...
       ~any(strcmp(f,'Rs'))|...
       ~any(strcmp(f,'Fs'))|...
       ~any(strcmp(f,'order'))|...
       ~any(strcmp(f,'special'))|...
       length(fdt)~=1
        flag = 0;
        return
    end

    if any(fdt.f<0) | any(diff(fdt.f<=0)) 
        flag = 0;
    end

⌨️ 快捷键说明

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