How can I change what parameters are visible in a masked block dialogue box?

4 views (last 30 days)
Hi,
I'm looking to create a masked system where the user is presented with an option of different parameter types to enter in the dialogue box but the selection of this parameter options should change what is presented to the user within the dialogue box.
I've tried using the example in the help file under "Creating Dynamic Mask Dialogue Boxes" but since the code being used is not explained well it will not work in my mask.
Any help or advice greatly appreciated!

Accepted Answer

Babak
Babak on 10 Sep 2012
When you are creating the mask, right click on the block and choose "edit MASK" then in the "Parameters" pane of the "Mask Editor" you will see your parameters defined. When you click on each of the parameters, you can deinf e callback function for each of the parameters by writing an m-file's name in Dialog callback. Or you can just simply write pieces of code there in Dialog callback. This code runs as a callback for that parameter.
In that code you can change the visibility of the mask parameters(as well as enabling or disabling them) with commands like this:
set_param(gcb,'MaskVisibilities',{'on';'off'})
where I make the first parameter visible but the second one invisible, and
set_param(gcb,'MaskEnables',{'on';'off'})
where I make the first parameter enabled but the second one disabled.

More Answers (0)

Categories

Find more on Author Block Masks 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!