Can’t get ‘ValueChangedFcn’ callback to work for ‘uidatepicker ‘
Hi,
I’m would like to have a date picker window on my main app window, and I’d like something to happen whenever the date is changed. The help file says I can call a function using the ‘ValueChangedFcn’ callback, but I can’t get it to work. This is the relevant piece of code:
methods (Access = private)
function test(app)
uialert(app.UIFigure, ‘It works!’, ‘It works!’, ‘Icon’,’help’);
end
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
uidatepicker(app.UIFigure, ‘Position’, [780 350 100 22], ‘ValueChangedFcn’, test(app))
I get this error message – Error using app1/test
Too many output arguments.
Error in app1 (line 431)
runStartupFcn(app, @startupFcn)
Any ideas?Hi,
I’m would like to have a date picker window on my main app window, and I’d like something to happen whenever the date is changed. The help file says I can call a function using the ‘ValueChangedFcn’ callback, but I can’t get it to work. This is the relevant piece of code:
methods (Access = private)
function test(app)
uialert(app.UIFigure, ‘It works!’, ‘It works!’, ‘Icon’,’help’);
end
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
uidatepicker(app.UIFigure, ‘Position’, [780 350 100 22], ‘ValueChangedFcn’, test(app))
I get this error message – Error using app1/test
Too many output arguments.
Error in app1 (line 431)
runStartupFcn(app, @startupFcn)
Any ideas? Hi,
I’m would like to have a date picker window on my main app window, and I’d like something to happen whenever the date is changed. The help file says I can call a function using the ‘ValueChangedFcn’ callback, but I can’t get it to work. This is the relevant piece of code:
methods (Access = private)
function test(app)
uialert(app.UIFigure, ‘It works!’, ‘It works!’, ‘Icon’,’help’);
end
end
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
uidatepicker(app.UIFigure, ‘Position’, [780 350 100 22], ‘ValueChangedFcn’, test(app))
I get this error message – Error using app1/test
Too many output arguments.
Error in app1 (line 431)
runStartupFcn(app, @startupFcn)
Any ideas? valuechangedfcn, uidatepicker MATLAB Answers — New Questions