フィルターのクリア

How to switch show between 2 static text in matlab GUI

1 回表示 (過去 30 日間)
Adisorn Phanukthong
Adisorn Phanukthong 2017 年 6 月 9 日
コメント済み: Jan 2017 年 6 月 19 日
hide A and show N ,hide N and show A
  3 件のコメント
Adisorn Phanukthong
Adisorn Phanukthong 2017 年 6 月 13 日
if cellfun(@(x)x == 'A',status)
set(handles.texta,'visible','on');
set(handles.textn,'visible','off');
else
set(handles.textn,'visible','on');
set(handles.texta,'visible','off');
end
right?
Adam
Adam 2017 年 6 月 13 日
I don't know what your exact code is that needs this, but you shouldn't need anything complicated like a cellfun, but you never really stated what the trigger is for changing the visible status.

サインインしてコメントする。

採用された回答

Jan
Jan 2017 年 6 月 9 日
Either change the String and Color property of one text object. Or set the 'Visible' property of one to 'on' and the other to 'off'.
  2 件のコメント
Adisorn Phanukthong
Adisorn Phanukthong 2017 年 6 月 13 日
if cellfun(@(x)x == 'A',status)
set(handles.texta,'visible','on');
set(handles.textn,'visible','off');
else
set(handles.textn,'visible','on');
set(handles.texta,'visible','off');
end
right?
Jan
Jan 2017 年 6 月 19 日
Perhaps: if any(strcmp(status, 'A')) is simpler as the cellfun approach. If your code works, it is right. Does it work?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by