Made some progress... I'm able to activate the correct Figure. The problem I run into is how to call the callback function using the new parameter ? I have this code executing in the First Figure :
RGB = inpict(IntY,IntX, :);
h = findall(0,'name',figurename);
figure(h); % Activate 'main' figure
ClickedPixel = rgb2lab([RGB(1) RGB(2) RGB(3)]);
sliderCB(ClickedPixel(1));
% sliderval = ClickedPixel(1);
% set(SliderH,'value',sliderval/100);
% update text label
% set(handles.lsliderdisplay,'String',num2str(round(sliderval)));
% updateplot();
I was considering manuall executing all the statements that are normally triggered by the Slider event but I 'reasoned' (?) I may only need to pass the new slider value to the slider call back? Which is defined this way :
function sliderCB(SliderH,~)
sliderval = SliderH.Value * 100;
% snap slider to closest bin center
[~,graylevelidx] = min(abs(sliderval - graylevels));
sliderval = graylevels(graylevelidx);
set(SliderH,'value',sliderval/100);
% update text label
set(handles.lsliderdisplay,'String',num2str(round(sliderval)));
updateplot();
end
I am aware that, as coded, the sliderCB callback only process the first parameter it receives as part of the event, since the is the presence of the tilde in the argument list. But Matlab gives me an error if I try to call the sliderCB function with only the first parameter :
Dot indexing is not supported for variables of this type.
Somehow, I have the intuition that I must "fill" the rest of the event parameters in my function call...