Borrar filtros
Borrar filtros

UIAxes CurrentPosition Bug on Matlab2022B (Was working fine on 2020B)

2 visualizaciones (últimos 30 días)
FURKAN TULUK
FURKAN TULUK el 28 de Mayo de 2024
Comentada: FURKAN TULUK el 31 de Mayo de 2024
Hello, I have an Appdesigner application and I plot data on UIAxes in my application. I click on the UIAxes plot to pick a point and press a button in UIFigure to find the CurrentPosition of that point, but since it conflicts with UIFigure's CurrentPosition, I find a value independent of UIAxes based on the current position of my mouse. This problem did not exist in Matlab 2020B, but I encountered this situation when I switched to 2022B. How can I solve this problem?

Respuestas (1)

Sarthak
Sarthak el 30 de Mayo de 2024
This is interesting. If there is a conflict between the CurrentPosition of UIAxes and UIFigure in MATLAB 2022B, it could be because how CurrentPosition used to be handled has changed.
As a workaround, you can try to create a callback function for the ButtonDownFcn event of the UIAxes. This function will be executed when you click on the UIAxes, and it can store the CurrentPoint property of the UIAxes in a separate variable.
Now, when you press the button in UIFigure, you can access the CurrentPoint of the UIAxes from the handles structure, instead of using the CurrentPosition property of the UIFigure.
Please note that this is a workaround, and it might not work in all situations. Reaching out to MathWorks Technical Support might be a good idea. In case you do, let me know the right way to do it as well. Otherwise the above mentioned workaround should work fine.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by