Linking Image processing code with GUI

12 visualizaciones (últimos 30 días)
Nasser Jarrar
Nasser Jarrar el 5 de Mzo. de 2018
Respondida: Jan el 5 de Mzo. de 2018
I would like to link my code with GUI. I'm using the function plot on the code to plot a circle, How can I let appear in GUI? The code consists of 100 lines. Do I have to put all of it in the callback of the push button?

Respuestas (1)

Jan
Jan el 5 de Mzo. de 2018
You could insert the lines directly in a callback. Or you call this function from the callback and provide a handle to an axes, which is created inside the GUI:
function YourCallback(ObjectH, EventData, handles)
Untitled(handles.axes1);
end
Now use the provided axes handle as Parent object for the displayed images, e.g.:
function Untitled(AxesH)
...
imshow(red, 'Parent', AxesH);
Omit e.g. subplot(1,2,1) then.
By the way: The shown code is hard to read and to understand. The lack of comments and orphaned variables (output_args? input_args? hp = impixelinfo(); but you do not export hp?) reduce the quality and usability of the code massively.

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by