Actualizar handles dentro de un uipushtool y ClickedCallback
2 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Walter Roberson
on 23 Oct 2016
[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?
0 Comments
See Also
Categories
Find more on Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!