Undefined function 'ImageClickCallbackHand' for input arguments of type 'matlab.gr​aphics.pri​mitive.Ima​ge'.

9 visualizaciones (últimos 30 días)
Keep getting the error:
Undefined function 'ImageClickCallbackHand' for
input arguments of type
'matlab.graphics.primitive.Image'.
Error while evaluating Image ButtonDownFcn.
Trying to make a GUI that has an image which I can get the coordinates from when GUI is running. The image appear on axis when Calibration Button is pressed.
function ImageClickCallbackHand (objectHandle, eventData)
app.axesHandle = get(objectHandle,'Parent');
app.coordinates = get(axesHandle,'CurrentPoint');
app.coordinates = app.coordinates(1,1:2);
end
function CalibrationButtonPushed(app, event)
myImage1 = imread('hand2.png');
resizePos1 = get(app.UIAxes, 'Position');
myImage1 = imresize(myImage1, [resizePos1(3) resizePos1(4)]);
imageHandle1 = imshow(myImage1,'Parent',app.UIAxes);
set(imageHandle1, 'ButtonDownFcn',@ImageClickCallbackHand)
end

Respuestas (1)

Rajani Mishra
Rajani Mishra el 16 de Abr. de 2020
Editada: Rajani Mishra el 16 de Abr. de 2020
Consider replacing the last line with call to set function with below code:
set(imageHandle1, 'ButtonDownFcn',@app.ImageClickCallbackHand);
I have found similar question, refer its link below:

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by