📄 find_blocksets.m
字号:
function [blocksets]=find_blocksets()
% Open the model of interest before running this file.
%
% This function will output what blocksets are used in the model you
% currently have selected.
%
% J. Kluza 10/30/03
clear
blocks=find_system(gcs, 'followlinks', 'on');
for i=1:length(blocks)
if not(isequal('block_diagram',char(get_param(blocks(i), 'type'))))
sources(i)=get_param(blocks(i), 'referenceblock');
if isempty(sources(i))
sources(i)=get_param(blocks{i}, 'ancestorblock');
end
if not(isequal(sources{i}, ''))
allblocksets(i)=cellstr(strtok(sources{i}, '/')) ;
end
end
end
if (isequal(sources{:}, ''))
disp('No blocksets were found.')
else
%disp('The blocksets used in this model are: ')
blocksets=unique(cellstr(strvcat(allblocksets{:})));
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -