Hi Eun Young Park,
To activate the thickness boxes based on dropdown selection in MATLAB App Designer, use the "ValueChanged" callback of the dropdown to enable the relevant "EditField" components. Implement logic in the callback to toggle the Enable property of each thickness box.
Here's a sample code snippet for the callback:
% Callback function for DropDown
function DropDownValueChanged(app, event)
value = app.DropDown.Value;
% Reset all EditFields to be disabled initially
app.StructureEditField.Enable = 'off';
app.Layer1EditField.Enable = 'off';
% Add more lines for additional layers if needed
% Enable EditFields based on dropdown selection
switch value
case '1'
app.StructureEditField.Enable = 'on';
case '2'
app.StructureEditField.Enable = 'on';
app.Layer1EditField.Enable = 'on';
% Add more cases for additional dropdown options if needed
end
end
To convert your MATLAB script to App Designer, identify user input and output sections in your script, create corresponding UI components in App Designer, and move the logic into callback functions.
Refer to this documentation to read more about callbacks in app designer: