How can I hide and unhide objects based on radio button selecions
4 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Elias Gule
2018-11-1
I think you need to set the Visible property to 'off' instead of 0, and 'on' instead of 1.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!