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

📄 bdrdhelp.m

📁 数字通信第四版原书的例程
💻 M
字号:
function bdrdhelp(file_name, win_name)
%BDRDHELP Reads masked block information into file FILE_NAME.
%       BDRDHELP(FILE_NAME) reads the current SIMULINK window information.
%       The function outputs the information in a masked block into the file
%       FILE_NAME.
%
%       BDRDHELP(FILE_NAME, WIN_NAME) reads SIMULINK window WIN_NAME 
%       information.
%
%       See also: BDWTHELP.

%       Wes Wang 10/20/95
%       Copyright (c) 1995-96 by The MathWorks, Inc.
%       $Revision: 1.1 $  $Date: 1996/04/01 19:31:50 $

% not enough parameter
if nargin < 1
    error('Not enough parameters.')
end;

% nargin == 1 format
if nargin < 2
    win_name = get_param;
    if isempty(win_name)
        disp('There is no SIMULINK window. Process terminated.')
        return;
    end;
end;

% blocks.
blks = get_param(win_name, 'blocks');
sys = [];
if isempty(blks)
    sys = strtok(win_name,'/');
    if isempty(sys)
        disp('There is no block in the given window. Process terminated.');
        return;
    else
        feval(sys);
        blks = get_param(win_name,'blocks');
    end;
end

%open file
fid = fopen(file_name, 'w');

for i = 1 : size(blks, 1)
    x = get_param([win_name '/' blks(i, :)], 'Mask Type');
    if ~isempty(x)
        fprintf(fid, '\n\n***Name***\n');
        fprintf(fid, blks(i, :));
        fprintf(fid, '\n***Type***\n');
        fprintf(fid, x);
        x = get_param([win_name '/' blks(i, :)], 'Mask Dialogue');
        fprintf(fid, '\n***Dial***\n');
        while ~isempty(x)
            [y, x] = strtok(x, '|');
            fprintf(fid, y);
            fprintf(fid, '\n');
        end;
        fprintf(fid, x);
        x = get_param([win_name '/' blks(i, :)], 'Mask Help');
        fprintf(fid, '***Help***\n');
        fprintf(fid, x);
        x = get_param([win_name '/' blks(i, :)], 'Mask Translate');
        fprintf(fid, '\n***Cmds***\n');
        [y, x] = strtok(x, ';');
        while ~isempty(x)
            fprintf(fid, [y ';']);
            fprintf(fid, '\n');
            [y, x] = strtok(x, ';');
        end;
        x = get_param([win_name '/' blks(i, :)], 'Mask Display');
        fprintf(fid, '***Disp***\n');
        fprintf(fid, x);
    end;
end;

fprintf(fid, '\n');
fclose(fid);
if ~isempty(sys)
    close_system(sys, 0);
end;

%--end of bdrdhelp--


⌨️ 快捷键说明

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