Matlab修改Model config

时间:2024-10-13 19:22:15

namelist = get_param(Simulink.allBlockDiagrams(),'Name');

if isempty(namelist)

    return;

end

if ischar(namelist)

    namelist={namelist};

end

for ii=1:length(namelist)

    activeConfigObj = getActiveConfigSet(namelist{ii});

    components = activeConfigObj.Components;

    if strcmp('ModelAdvisor.ConfigsetCC',class(components(end)))

        activeConfigObj.Components(end).remove;

%         attachConfigSet(namelist{ii},activeConfigObj);

%         set_param(activeConfigObj,'Name','VdpConfigRef')

%         setActiveConfigSet(namelist{ii},'VdpConfigRef');

    end

    clear activeConfigObj components

end

这是将模型检查的Component删除