Help with error code "Undefined function 'Callbackfn11' for input arguments of type 'double'."

2 views (last 30 days)
So here is part of my code so far. Every time I try to run it, I get the "Undefined function 'Callbackfn11' for input arguments of type 'double'." error code. I am not sure where my error is and was wondering what is going wrong here and why can I not get the slider value.
Thank you!
function guislider
finalcount=1;
f=figure('Visible','on','color','white','Units','Normalized','Position',[.30,.40,.50,.60]);
minval=0;
maxval=10;
hstext6=uicontrol('Style','text','Units','Normalized','Position',[.30,.70,.40,.20],'String','How tired are you?');
quiz6ans1=uicontrol('Style','slider','Min',minval,'Max',maxval,'Units','Normalized','Position',[.30,.55,.40,.10],'Callback',@Callbackfn11);
slidetext1=uicontrol('Style','text','BackgroundColor',[1 1 .5], 'Units','Normalized','Position',[.12,.42,.15,.3],'String','I''ve had more sleep than a bear in hybernation','FontSize',7);
slidetext2=uicontrol('Style','text','BackgroundColor',[.75 0 0] ,'Units','Normalized','Position',[.75,.42,.15,.3],'String','I''ve been running on caffeine and prayer','FontSize',7);
function callbackfn11(source,eventdata)
num=get(quiz6ans1,'Value');
if num<=1
x=[1 2 3 4];
y=[3 2 2 3];
polyfit(x,y,2)
end
finalcount=finalcount+num;
set([quiz6ans1,slidetext1,slidetext2,hstext6],'visible','off')
end

Answers (1)

Walter Roberson
Walter Roberson on 8 Dec 2015
You call upon Callbackfn11 but you define callbackfn11 with a lower-case C

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!