MATLAB: Is there any way to access the text of a Simulink DocBlock

simulinksimulink docblock text find_system

Does anybody know a way to access the Text of a Simulink DocBlock in a model via command line, using find_system command ?

Best Answer

% Find docblocks in model
dBlkH = find_system('MyModel', 'BlockType', 'SubSystem', 'Mask', 'on', 'MaskType', 'DocBlock');
% Extract the docblock text
dBlkUData = get_param(dBlkH(1), 'UserData');
bBlkText = dBlkUData.content;