필터 지우기
필터 지우기

Why ' gpos.m' is not working( ginput with posiiton of the current axes)?

조회 수: 2 (최근 30일)
Lavanya
Lavanya 2022년 9월 21일
편집: Rik 2022년 10월 19일
gpos.m file should work like GINPUT provided by Matlab,but it traces the position of cursor without click and is designed for 2-D axes. But Its getting error using in app designer?
Error:
Error using gpos
Too many input arguments.
Can any one help me with this?
  댓글 수: 3
Rik
Rik 2022년 9월 28일
I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.
This page is now archived on the Wayback Machine. Unfortunatly, the attached file could not be recovered.
Rena Berman
Rena Berman 2022년 10월 19일
(Answers Dev) Restored edit

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

채택된 답변

Walter Roberson
Walter Roberson 2022년 9월 21일
Change
app.tfig = [app.tfig, figure('Name', 'points','WindowButtonMotionFcn',@gpos)];
to
app.tfig = [app.tfig, figure('Name', 'points','WindowButtonMotionFcn',@(src,event)gpos(ancestor(src,'axes')))];
  댓글 수: 3
Lavanya
Lavanya 2022년 9월 22일
this will work for ginput() and position as well?
Walter Roberson
Walter Roberson 2022년 9월 22일
I am unclear on the goal here.
Is the goal to be able to have gpos work on uiaxes (which would be in uifigure) ?
Is the goal to be able to have gpos work on traditional axes inside uifigure ?
Is the goal to be able to have gpos work on traditional axes inside traditional figures that just happen to be dynamically created inside App Designer ?
I started converting your code to use uifigure under the assumption that you would want to use gpos with (static) axes created by App Designer, but I gave up at the point where it told me that subplot() could not be used inside that kind of containers that have "automatically resize children" configured.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by