Can I use ginput (or an analog) in the 2016a App Designer?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
alex
el 28 de Mayo de 2016
Respondida: Adam Danz
el 7 de Ag. de 2022
Is there a way to use the ginput function (https://www.mathworks.com/help/matlab/ref/ginput.html) in the new App Designer? Or is there another function that allows you to generate points by clicking on parts of an Axes (Line and Scatter)? For reference, I would like to be able to do something like this:
function startupFcn(app)
%uiopen
app.xdata = linspace(0, 3*pi, 10);
app.ydata = cos(app.xdata) + rand(1, 10);
plot(app.UIAxes, app.xdata, app.ydata, 'Linewidth',.7);
[x,y] = ginput(2);
end
Thank you!
0 comentarios
Respuesta aceptada
Adam Danz
el 7 de Ag. de 2022
ginput is supported in AppDesigner figures starting in MATLAB R2020b
For more info:
0 comentarios
Más respuestas (3)
Ian Hersom
el 15 de Ag. de 2016
It hasn't been working for me, I sure would like it to though.
0 comentarios
glvbx unbsl
el 12 de Ag. de 2018
Need a solution to a similar problem in the App Designer. I would like to obtain the coordinates of a point on a figure (actually a displayed image in that figure) using the mouse click. But I am not able to implement this in the App Designer. When using ginput, it opens a new figure. I can't set the UIFigure as the current figure using figure(app.UIFigure). Can I direct ginput to use this UIFigure?
I tried [x,y] = getpts(app.UIAxes); but I get an error message "Functionality not supported with figures created with the uifigure function."
I believe I am missing something, it is unlikely that App Designer doesn't allow picking points off a uifigure.
0 comentarios
Michael Werthmann
el 7 de Mzo. de 2019
ginput si not supported. See link for more Information
https://de.mathworks.com/help/releases/R2018a/matlab/creating_guis/graphics-support-in-app-designer.html
0 comentarios
Ver también
Categorías
Más información sobre Develop uifigure-Based Apps 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!