How can we set parameter values like Minimum or Maximum for a Slider and bind it to a tunable block like a Constant, using matlab commands?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
In Matlab 2015B, working on simulink Dashboard elements, how can we set parameter values like Minimum or Maximum for a Slider and bind the Slider to a tunable block like a Constant, using matlab commands?
I tried using the steps in this link:
Given below is an example snippet from this link:
----------------------------------------------------------------------------------------------------------
Connect and Configure the Slider Block
Use a Simulink.HMI.ParamSourceInfo object and the set_param function to connect the Slider block to the Gain parameter of the Mublock. To connect a parameter, the Simulink.HMI.ParamSourceInfo needs to specify the block path for the block that corresponds to the parameter and the name of the parameter.
slider_param = Simulink.HMI.ParamSourceInfo;
slider_param.BlockPath = Simulink.BlockPath('vdp/Mu');
slider_param.ParamName = 'Gain';
set_param('vdp/Slider',"Binding",slider_param)
Configure the scale for the slider for a range of 1 to 10 with a tick mark spacing of 1.
slider_limits = [1 1 10];
set_param('vdp/Slider',"Limits",slider_limits)
----------------------------------------------------------------------------------------------------------
In the above example, The set_param statements setting the "Binding" or "Limits" parameters do not work for me and result in the following error:
MWDashboardBlock block (mask) does not have a parameter named 'Binding'
MWDashboardBlock block (mask) does not have a parameter named 'Limits'
How do I get these set_param statements to work? Also, I do not understand the reason for usage of double quotes in setting the "Binding" and "Limits" parameters.
If the above example is incompatible with Matlab 2015B, then what would be an alternative method in Matlab 2015B to set parameter values like Minimum or Maximum for a Slider and bind it to a tunable block like a Constant, using matlab commands? I have not yet found a different example that illustrates this.
0 Commenti
Risposte (1)
Fangjun Jiang
il 16 Set 2019
"abc" marks the string data type, which is introducted in R2016b. You can just use 'Binding' in R2015b.
3 Commenti
Fangjun Jiang
il 17 Set 2019
The example in your link is for later versions (R2019a or R2019b). Sometimes there are incompatibilities between versions. That is all.
Vedere anche
Categorie
Scopri di più su Control Simulations with Interactive Displays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!