필터 지우기
필터 지우기

How can I use the brush tool after compile my app in appdesigner?

조회 수: 12 (최근 30일)
Edwin Henry Jara Bardales
Edwin Henry Jara Bardales 2022년 12월 29일
편집: Cameron 2023년 1월 1일
When I run my app in MATLAB platform, everything is ok, but when I compile the app, the brush tool doesn´t work. I am using R2022a. So I need to know how to use this tool in an .exe for the UIAxes, because I need to select some points on the app. Regards.

답변 (1개)

Cameron
Cameron 2022년 12월 29일
편집: Cameron 2023년 1월 1일
Can you clarify your question a bit more? What are you trying to do, and what is your app doing instead of allowing you to brush your data?
I have had a similar issue, but I can't tell if it's the same as yours from your description. I got around my problem by clicking the brush button, moving my cursor over the UIAxes momentarily, moving the cursor back over the axtoolbar area (where your brush tool is located), and then being able to brush my data.
  댓글 수: 3
Edwin Henry Jara Bardales
Edwin Henry Jara Bardales 2022년 12월 31일
편집: Edwin Henry Jara Bardales 2022년 12월 31일
@Cameron, in addition:
When I call the subprogram, I ensure (in the main program) that brush data tool is activated using:
Apoyos; % This line calls the subprogram which has the title: 'ASIGNAR RESTRICCIÓN EN NODO'
brush(app.UIAxes_modelofinal,'on') % This line is to activate the brush data tool.
What am I doing wrong? or what Can I do to correct that problem when i Compile in order to get the .exe program?
Cameron
Cameron 2023년 1월 1일
Seems like there are two issues. The first (and hopefully easiest) is how to keep the brush data tool visible in the axis toolbar. I think you can just run the code below to ensure the brush tool is available.
Apoyos;
axtoolbar(app.UIAxes_modelofinal,{'brush','pan','restoreview'});
brush(app.UIAxes_modelofinal,'on')
The the only time I've seen the brush tool disappear is when you try to add the brush but don't plot any data like this:
ax = uiaxes;
axtoolbar(ax,{'brush','pan','restoreview'});
I also noticed that if you try to force the brush tool to be active when there's no data in the plot, it can do some strange things. For example, if you run this:
ax = uiaxes;
axtoolbar(ax,{'brush','pan','restoreview'});
brush(ax,'on')
then the brush tool will be active. But once you click the brush again to disable the function, it will disappear because there is no data in the uiaxes.
The second part of your issue is a bit stranger. So your code runs fine within App Designer, but once you compile your program into an executable, you're unable to select any points because the cursor doesn't turn into the crosshair, right? I'll try to replicate it on my end but I need to know which version of MATLAB you're using first. Did you try my workaround where you click the brush tool to turn it on (or I guess in your case do it programatically), then move your cursor over the uiaxes, then move it back over the brush tool and then try to select your points? This has worked when I've had the issue where my cursor doesn't change from a pointer to crosshair.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by