How can I hide and unhide objects based on radio button selecions

4 views (last 30 days)
I want to hide the deviation and matrix dimensions for the first case. For the second case I just want the matrix dimensions to show. And for the Last case I want to display all fields. Here's my code. Please let me know what I am doing wrong here.
function startupFcn(app)
app.NoiseButtonGroup.Visible=0;
app.AddNoiseButton.Visible=0;
app.DeviationEditField.Visible=0;
app.EditFieldm.Visible=0;
app.EditFieldn.Visible=0;
app.MatrixDimensionsLabel.Visible=0;
app.DeviationLabel.Visible=0;
end
if(app.MeanButton.Value==1)
app.DeviationEditField.Visible=0;
app.EditFieldm.Visible=0;
app.EditFieldn.Visible=0;
app.MatrixDimensionsLabel.Visible=0;
app.DeviationLabel.Visible=0;
elseif(app.MedianButton.Value==1)
set(app.DeviationEditField, 'Visibile','on');
app.EditFieldm.Visible=1;
app.EditFieldn.Visible=1;
app.MatrixDimensionsLabel.Visible=1;
app.DeviationLabel.Visible=0;
else
app.DeviationEditField.Visible1;
app.EditFieldm.Visible=1;
app.EditFieldn.Visible=1;
app.MatrixDimensionsLabel.Visible=1;
app.DeviationLabel.Visible=1;
end

Answers (1)

Elias Gule
Elias Gule on 1 Nov 2018
I think you need to set the Visible property to 'off' instead of 0, and 'on' instead of 1.

Products

Community Treasure Hunt

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

Start Hunting!