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

📄 comwksp.m

📁 数字通信第四版原书的例程
💻 M
字号:
function comwksp(op_flag, data);
%        I/O workspace operation
%        create a figure

%       Wes Wang 1995 X-mas day
%       Copyright (c) 1995-96 by The MathWorks, Inc.
%       $Revision: 1.1 $  $Date: 1996/04/01 17:55:30 $

if op_flag
   name = 'Export ';
else
   name = 'Import ';
end;
default_color = get(0,'defaultuicontrolbackgroundcolor');
f_h = figure(...
        'Name', [name 'Data for Communication Bit Error Computation.'],...
        'NumberTitle','off',...
        'Unit', 'normal',...
        'MenuBar', 'none',...
        'Position', [.2, .4, .5, .3],...
        'Visible','off',...
        'NextPlot','Add',...
        'color', default_color ...
        );
f_h(6) = axes('position',[0 0 1 1], 'Visible','off', 'next', 'add');   
editable = [1 1 1];    
text(.3, .8, [name 'Workspace Variable']);
tmp = text(.01, .6, 'Signal to Noise Ratio:');
set(tmp, 'Fontsize', 10);
tmp = text(.01, .4, 'Bit Error Ratio:');
set(tmp, 'Fontsize', 10);

f_h(2) = uicontrol('Style','edit',...
            'Unit','norm',...
            'BackgroundColor', editable,...
            'String','snr',...
            'Position', [.4 .5 .55 .15]...
         );
f_h(3) = uicontrol('Style','edit',...
            'Unit','norm',...
            'BackgroundColor', editable,...
            'String','ber',...
            'Position', [.4 .3 .55 .15]...
         );
f_h(4) = uicontrol('Style', 'pushbutton',...
            'Unit', 'norm',...
            'Position', [.2 .05 .2 .12],...
            'String', 'OK',...
            'Callback','comvarb;close(gcf);'...
         );
f_h(5) = uicontrol('Style', 'pushbutton',...
            'Unit', 'norm',...
            'Position', [.6 .05 .2 .12],...
            'String', 'Cancel',...
            'Callback','close(gcf);'...
         );
set(f_h(1),'Visible','on',...
           'UserData', [f_h, op_flag]);
set(f_h(6),'UserData', data);

⌨️ 快捷键说明

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