How to add/display Hyperlink of folder/file in the App Designer?

15 次查看(过去 30 天)
I'm building app in App Designer. i want to display/add Hyperlink to a folder or specific file from my PC.
I look and found something that works in standard matlab. when i tried to display it in my app, i see only the text itself and not link.
see code:
folder = uigetdir();
disp(['','<a href = "matlab: [s,r] = system(''explorer ',folder,' &'');">',folder,'</a>','']);
this code in the command line, shows hyper link (see picture 1.jpg)1.jpg
but in my app, it shows as text (see picture 2.jpg)
2.jpg
can someone show me how to add in the app designer hyperlink?
the next step will be to know how to connect the hyperlink to an image...
Best Regards

回答(1 个)

Jayanti
Jayanti 2024-12-18,11:09
Hi Gili,
To add hyperlink, you can use “web” function.
web(url)
This will open the page specified by url in a web browser. 
And for release MATLAB R2021a or later, uihyperlink” function can be used alternatively.
fig = uifigure;
hlink = uihyperlink(fig);
hlink.Text = " https://www.mathworks.com/";
hlink.URL = "https://www.mathworks.com/";
The above code will create a hyperlink component.
Please refer to below documentation links on “web” and “uihyperlink” for your reference.
Hope this is useful!

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by