StandAlone Matlab app don't show the points with the interection with the mouse

I am building an app in matlab app desing that the user needs to interact with the graph with a mouse and in the app designer appears the points like in the figure. But when I create the standAlone app, this interaction with the graph disappears. Does someone know how to solve it?

12 Commenti

Are you having your code call datatips() or are you having your code turn on chart interactions https://www.mathworks.com/help/matlab/creating_plots/control-axes-interactions.html
I didn't write a code to access the datatips, always appears to me automatically. But when I compiles the app, this function disappear
datatips never appear automatically in regular graphs (possibly specialized graphs such as bode plot might enable them.) datatips either have to be turned on with a datatips() call, or chart interactivity has to turn them on, or the user has to click the datatip button in the axes toolbar.
So, How can I call this fuction? beacause in the app designer run test, it work finally, but when I create the .exe, this function dont appear.
Yes, but where I put this? StartupFn? When the button is pushed?
Gives a error message: "Undefined function 'datatips' for input arguments of type 'char'."
This fig reference is the app.UIAxes or the UIFigure?
You can select the axes or the figure. For me it worked by using the app.UIAxes

Accedi per commentare.

Risposte (1)

Enable or Disable Built-In Interactions
To control whether a set of built-in interactions is enabled within a chart, use the disableDefaultInteractivity and enableDefaultInteractivity functions. Sometimes MATLAB® automatically disables the built-in interactions. For example, they might be disabled for charts that have special features, or when you implement certain callbacks such as a WindowScrollWheelFcn.
You can try calling enableDefaultInteractivity after you have plot something on the UIAxes
function plotfunction(app,....)
% ... code to plot ....%
enableDefaultInteractivity(app.X); % app.X where X is the name of your UIAxes object
% alternative method to only enable dataTipInteractions.
app.X.Interactions = [dataTipInteraction]; % app.X where X is the name of your UIAxes object
end
More details can be found at the link below.
https://www.mathworks.com/help/releases/R2021a/matlab/creating_plots/control-axes-interactions.html

Categorie

Scopri di più su Develop Apps Using App Designer in Centro assistenza e File Exchange

Prodotti

Release

R2020b

Richiesto:

il 24 Lug 2022

Commentato:

il 28 Giu 2024

Community Treasure Hunt

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

Start Hunting!

Translated by