I have develop a programs which has several buttons. Les's say pushbutton1 and pushbutton2. When pushbutton1 is pushed, the program is running. However, when pushbutton2 is pressed, following error is appear. What is the problems?
Error usingtpac6de6f0_2275_443d_a558_3c8bef237e41>pushbutton2_Callback (line1124)Not enough input arguments.Error using drawnowError while evaluating uicontrol Callbackif val1==1y1=audioread(strcat(handles.path_wave,handles.name_wave),[round((counter-1)*len*Fs)+1 round((counter)*len*Fs)-1]);handles.player1 = audioplayer(y1, Fs);j=i+1;% save all data to the handles object
handles.y = y1';handles.Fs = Fs;handles.timeSec = length(y1)/Fs;handles.atSample = 0;[row col]=size(y1);while flag1==0 try play(handles.player1); tic H3=scatter(handles.axes3,[1:counter],play_time(1:counter),10); set(H3,'MarkerFaceColor','red'); set(H3,'MarkerEdgeColor','red'); set(H3,'LineWidth',1); % assign a periodic timer to fire during playback
cla(handles.axes2); h1=plot(handles.axes2,y1); set(h1,'linewidth',0.001) set(h1,'color',[0.5 0.5 0.5]) overal=overal+len; counter=counter+1; y2=audioread(strcat(handles.path_wave,handles.name_wave),[round((counter-1)*len*Fs)+1 round((counter)*len*Fs)-1]); handles.player2 = audioplayer(y2, Fs); flag_forward=0; flag_backward=0; real_time=toc; while real_time<len && flag_forward==0 && flag_backward==0 if (time(j)-time(i))<real_time && time(j)<overal H=scatter(handles.axes1,Normalized_Longitude(j),Normalized_Latitude(j),'b'); set(H,'MarkerFaceColor','blue'); set(H,'MarkerEdgeColor','blue'); handles.F(j) = getframe(gcf); refreshdata drawnow i=j; j=i+1; end temp_flag=0; a=get(handles.pushbutton4, 'userdata') ; b=get(handles.pushbutton2, 'userdata') ; real_time=toc; while ~a || ~b a=get(handles.pushbutton4, 'userdata') ; b=get(handles.pushbutton2, 'userdata') ; pause(handles.player1); drawnow; temp_flag=1; end if temp_flag==1 tic timer1=toc; while (timer1-real_time)<0.00001 timer1=toc; end resume(handles.player1); endfunction pushbutton2_Callback(hObject, eventdata, handles)*error is here=>* if get(handles.pushbutton2,'userdata')==1set(handles.pushbutton2,'userdata',0);elseset(handles.pushbutton2,'userdata',1);end
Best Answer