mkaccel.m

来自「数字通信第四版原书的例程」· M 代码 · 共 30 行

M
30
字号
function mkaccel(sys)
%MKACCEL(SYS) builds the specified block diagram's MEX file.
%	Calling this function is equivalent to choosing
%	'Build Accelerator...' from the Simulate menu.

%	Rick Spada  11-23-92
%	Copyright (c) 1990-94 by The MathWorks, Inc.

% if no sys specified, use the current block diagram
if nargin==0,
  sys=get_param;
end;

% no block diagram, go bye
if isempty(sys),
  error('No block diagram specified.');
end;

% get the compile command, and change '$model' to the model name
compile_command=strrep(get_param(sys,'Compile command'),'$model',sys);

% last thing to do is to codegen the block diagram and  evaluate
% the compile command
genres=gencode(sys);
if genres~= 0.
  disp(compile_command);
  eval(compile_command);
end

⌨️ 快捷键说明

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