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

4 visualizaciones (últimos 30 días)
Jijo Varghese
Jijo Varghese el 1 de Nov. de 2018
Respondida: Elias Gule el 1 de Nov. de 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

Respuestas (1)

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

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by