Drag and Drop Custom Blocks on UIAxes in MATLAB
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello. I'm trying to build an app on the MATLAB App Designer. The app is about Path Planning and Path Following of a Ground Vehicle. The thing is that in the Path Planning Algorithm, I want to add certain Obstacles (explained in the figure below), and then the algorithm will find the optimal path accordingly.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1558589/image.png)
What I want is to make these movable. Or maybe to pick and drop from a sidebar? Is it possible to do so that I can place obstacles wherever I want?
댓글 수: 1
Ayush Singh
2023년 12월 21일
Hi Fawad,
I understand you want to add movable objects in the UI axes.
Can you let me know that do you want them to move randomly or based on some mouse movement or key press?
답변 (1개)
Voss
2023년 12월 21일
"What I want is to make these movable. Or maybe to pick and drop from a sidebar? Is it possible to do so that I can place obstacles wherever I want?"
All of those things are possible. You will need to define the UIFigure's WindowButtonDownFcn, WindowButtonMotionFcn, and WindowButtonUpFcn. See the "Window Callback" section of this page: https://www.mathworks.com/help/matlab/ref/matlab.ui.figureappd-properties.html
Good luck!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!