MATLAB: App designer, making components visible

app designercomponentsMATLABvisible

im having trouble turning on and off visiblity of a dropdown component and a button component
This error has come up for "switch expression must be a scalar or a character vector
app.SelectfeildDropDown.ValueChangedFcn
app.SelectfeildDropDown.Items
for
app.SelectfeildDropDown.Value
nothing happens we i change the value on the GUI
% Callbacks that handle component events
methods (Access = private)
% Value changed function: SelectfeildDropDown
function SelectfeildDropDownValueChanged(app, event)
switch(app.SelectfeildDropDown.DropDown.value)
case 'select'
case 'Tempreture'
app.MetrictoImperialButton.Visible
app.DropDown.Visible
case 'Length'
app.MetrictoImperialButton.Visible
app.DropDown.Visible
case 'Mass'
app.MetrictoImperialButton.Visible
app.DropDown.Visible
end
end
end

Best Answer

You can't switch on the function name. You have to switch on the "Value" property, not the callback function's name, like:
switch app.SelectfeildDropDown.Value
Check spelling -- did you mean field instead of feild?
Then, I think you need to actually set the Visible property to something to show or hide it. So do something like
app.DropDown.Visible = 1; % 1 to show. 0 to hide.
Or maybe they use 'on' and 'off' instead of 1 and 0. They are inconsistent about that (at least in GUIDE they were). So if 1 and 0 don't work, try 'on' and 'off'