Hi,
In AppDesigner I created an app that creates a slider at runtime:
Tt_end_slider = uislider();Tt_end_slider.Position = app.emptySlider_2.Position;Tt_end_slider.Tag='t_end';Tt_end_slider.UserData=i;Tt_end_slider.ValueChangedFcn = @(source, event) app.osc_prev_slider_ValueChanged ;
The Callback is defined as follows
% Callback function
function osc_prev_slider_ValueChanged(app, event) value = event.Source.Value;[..] end
Using the slider, I get this error:
Not enough input arguments.
Error in tutorialApp/osc_prev_slider_ValueChanged (line 575)
value = event.Source.Value;
Error in tutorialApp>@(source,event)app.osc_prev_slider_ValueChanged (line 325)
Tt_start_slider(i).ValueChangedFcn = @(source,event)app.osc_prev_slider_ValueChanged ;
I couldn't find how to correctly pass the requested argument to the callback ( I tried with @(source,event) looking at the callbacks assigned using the graphic interface)
Best Answer