Actualizar handles dentro de un uipushtool y ClickedCallback

조회 수: 6 (최근 30일)
Jose abel De la Fuente
Jose abel De la Fuente 2016년 10월 23일
답변: Walter Roberson 2016년 10월 23일
Buenas tardes amigos.
El motivo de mi pregunta es para saber si alguien de ustedes sabe actualizar el handles que se ha pasado como parámetro a una función handles desde un objeto uipushtool en su evento ClickedCallback.
function plotSin(hObject, handles)
cmP=10;
cnP=10;
fh = figure;
tbh = uitoolbar(fh);
uipushtool(tbh,'CData',imread('Complementos\Rojo.png'),'Separator','off',...
'TooltipString','Your toggle tool',...
'HandleVisibility','off',...
'ClickedCallback',...
{@marcarPunto,handles, cmP,cnP});
function marcarPunto(hObject,event,handles,cmP,cnP)
[handles.pnSin(cnP,cmP),handles.pmSin(cnP,cmP)]=ginputc(1, 'Color', 'w');
guidata(hObject,handles);
Tomando en consideración que dentro de la estructura handles tengo las matrices pnSin, pmSin.
El problema es que no logro actualizar el handles que entra como parámetro en la función principal (plotSin) cuando el handles llega a la función marcarPuntos,.
Gracias por su ayuda.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 10월 23일
[handles.pnSin(cnP,cmP),handles.pmSin(cnP,cmP)]=ginputc(1, 'Color', 'w');
is saving both outputs of ginputc() to the same place, which will result in handles.pmSin(cnP,cmP) holding only the y value. Is that what you want?

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by