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

9 次查看(过去 30 天)
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!

采纳的回答

Babak
Babak 2012-9-10
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Author Block Masks 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by