www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgfeature/buildsl.m

    function [h,p,msg] = buildsl(e,blockname,Sopts)
%BUILDSL build simulink block for expression
% 
% [h,p,msg] = buildsl(e,blockname,sType)

%  Copyright 2007-2012 The MathWorks, Inc. and Ford Global Technologies, Inc.
global testVal 

if ~Sopts.Export
    % Normal build (feature is treated as input)
    add_block('built-in/Inport',blockname,...
        'foregroundcolor','green');
    thisVal = eval(e);
    testVal = [testVal thisVal(1)];
    h=get_param(blockname,'handle');
    p=[];
    msg = '';
else
    % EXPRT Build
    % Create a subsystem
    % The '2' signifies that this is a child of a feature
    % and so will not require a refernce area
    msg = buildSLSystem(e,blockname,2,Sopts);
    h = get_param(blockname,'handle');
    set(h,'ForegroundColor','green')
    p= []; % getinports(e);
end