Actualizar handles dentro de un uipushtool y ClickedCallback
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Walter Roberson
il 23 Ott 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 Commenti
Vedere anche
Categorie
Scopri di più su NaNs in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!