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

조회 수: 2 (최근 30일)
Jijo Varghese
Jijo Varghese 2018년 11월 1일
답변: Elias Gule 2018년 11월 1일
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

답변 (1개)

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

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by