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

1 Ansicht (letzte 30 Tage)
Jijo Varghese
Jijo Varghese am 1 Nov. 2018
Beantwortet: Elias Gule am 1 Nov. 2018
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

Antworten (1)

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

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by