Using impixelinfo with appDesigner

조회 수: 8 (최근 30일)
Roger Breton
Roger Breton . 2021년 12월 27일
답변: Rishabh Singh . 2022년 1월 12일
I am running into the following error with appDesigner, when trying to retrieve the pixel info an an image component :
This is the app interface :
All I want to achieve, at this stage, is to get some information about the pixels at the mouse position.
I thought of using impixelinfo but it needs some argument? I tried :
But that's when I get the above error message. I read somewhere that impixelinfo does not work with appDesigner?
Eventually, I would like to capture the mouseover and mouseclick events so that I can display not only the image RGB values but also, and more importantly, the CIE Lab values. Ultimately, I would like to turn mouseclicks into a selected 3D points in the scatter3 plot on th right... Tall order for a Matlab and appDesigner newbie like me -- I know.
Any help is appreciated.
  댓글 수: 1
Roger Breton
Roger Breton 2021년 12월 29일
Just want to say that I'm studying the code here :
There is a LOT I have to learn but, withe help of the debugger, it helps a lot.
So far, I ran the code at the above link and I can see that this partly does what I need to do, which is to return some values in response to a mouseover movement over some graphic object. To wrap one's brain around the used symbols is not for the faint of heart... Needless to say, I'm discovering a whole world but I'm not totally lost, programming wise. I just have not a "mental" map of Matlab's object model... But I'm getting there.

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

답변 (1개)

Rishabh Singh
Rishabh Singh 2022년 1월 12일
A possible workaround for your problem could be using a figure window outside your app.
function ButtonPushed(app, event)
img =;
hp = impixelinfo();
set(hp, 'Position', [5 1 300 20]);
Here I have used a "ButtonPushed" callback to trigger the figure window, and there you can use "impixelinfo". You can also explore "datacursormode" and "getCursorInfo" for picking up data points using cursor.
Hope this helps.


Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기




Community Treasure Hunt

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

Start Hunting!

Translated by