Hyperlink to PDF in Matlab plot
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I have a GUI in which the user opens 4 popupmenus one after another and then is asked to enter coordinates and diameters of multiple circles. After doing this, the GUI presents a plot of the circles. I would like to add hyperlinks to the plots so the for each circle, a different PDF/word/text file is opened. The file should be also different for every selection of choices in the popupmenus How can I do that?
0 comentarios
Respuestas (1)
Daksh
el 2 de Feb. de 2023
I understand you have a GUI figure with plots in MATLAB for which you intend to attach hyperlinks to PDFs or other files available.
You can do so by adding "uibutton" in GUI figure, and then writing a MATLAB function for action when button is pressed. Inside the method call, you can open the PDF file link and this can serve as a hyperlink. You can also add multiple buttons of different shapes, sizes and forms and configure method calls for each of them
Here is an example
function buttonPlot
% Create a figure window
fig = uifigure;
% Create a push button
btn = uibutton(fig,'push',...
'Position',[420, 218, 100, 22],...
'ButtonPushedFcn', @(btn,event) plotButtonPushed(btn));
end
% Create the function for the ButtonPushedFcn callback, which opens
% "file101.pdf", a dummy pdf to be opened
function plotButtonPushed(btn)
disp("Opening relevant PDF file")
open('file101.pdf');
end
Hope this helps!
0 comentarios
Ver también
Categorías
Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!