フィルターのクリア

I have a GUI, button and text box, When I press the button, I want a link to appear in the text box, So when I click on the link, it takes me to the site

1 回表示 (過去 30 日間)
url = 'http://www.matlabcentral.com'
sitename = 'The MathWorks Web Site'
fprintf('<a href = "%s">%s</a>\n',url,sitename)
set(handles.edit1, 'String', sitename)

採用された回答

Walter Roberson
Walter Roberson 2021 年 12 月 20 日
You appear to be using GUIDE.
When you use "traditional figures" such as GUIDE uses, then uicontrol style 'edit' and uicontrol style 'text' will not have any HTML respected. HTML is only respected for pushbutton togglebutton checkbox radiobutton listbox popupmenu .
However... if you use any of those, clicking on the link will not do anything unless you configure specially.
Probably the easiest approach is to
url = 'http://www.mathworks.com/matlabcentrl'
sitename = 'The MathWorks Web Site'
set(handles.pushbutton1, 'String', sitename, 'Callback', @(hObject, event) web(url))
That is, make it a button whose action is to open the browser.
  1 件のコメント
Anwar Al Saleh
Anwar Al Saleh 2021 年 12 月 20 日
Thank you very much for your answer
I benefited so much
And it has been implemented

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

その他の回答 (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