Dynamic Masking using Checkboxes
23 views (last 30 days)
Show older comments
Hello,
I'm having some trouble getting a dynamic mask setup that uses checkboxes. I'm trying to create a block where checkboxes control which output ports are visible and not. I'd like it so that when a checkbox is unchecked, it's corresponding block output port is no longer visible. Here is the code I've found and modified for the dialog callback:
thisVariable = 'quatStatus';
affectedVars = 'Port';
thisBlock = gcb();
thisVarState = get_param(thisBlock, thisVariable);
maskNames = get_param(thisBlock, 'MaskNames');
maskEnables = get_param(thisBlock, 'MaskEnables');
for varName = affectedVars
varIndex = find(ismember(maskNames, varName));
maskEnables{varIndex} = thisVarState;
end
set_param(thisBlock, 'MaskEnables', maskEnables);
where quatStatus is the variable I've assigned to the checkbox parameter. I think the issue is that I'm not controlling the port I'm interested in.
Thanks!
0 Comments
Answers (1)
Guy Rouleau
on 20 Jan 2013
In R2012b we added new examples showing how this can be done:
This post might also be useful:
See Also
Categories
Find more on Subsystems in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!