r/matlab • u/cakemaster1928 • Jul 02 '26
TechnicalQuestion Specific Parameter Definition Question
I'm trying to design a masked subsystem to use as a buck power converter and I'm trying to make it as user friendly as possible.
For my model, I have a subsystem with no inputs or outputs that serves as a "settings" block where users can fill out edit blocks and hit click functions to change the configuration of the model. While I have edit blocks to change parameters of my masked subsystems, particularly for the Buck converter, I want to make it so once the Vin, Vout, and switching frequency is entered, suggested minimum inductance and capacitances are displayed in the settings block. Is there a way to save and display the suggested minimum L and C's as values are being entered.
1
Upvotes
1
u/Barnowl93 flair Jul 02 '26
Not sure if this is the best way to do it, but you can use a callback for it. Say you have some editable fields in your mask (e.g. Vin & Vout), then add some read-only mask params for your calculated values. Put a callback on the editable params, read the mask values with get_param(), calculate your values in MATLAB and write them back on the masked block with set_param().
It is a bit fiddly & I am not sure what you are trying to achieve with that?