I'm trying to give 2 points from user and showing the spectrogram between those points, I do it with following codes successfully, But I don't know why get I below Errors?
Also I want to know, if I want to put a reset button in my code to revert the plot to initial state how can I do that?
function From_Callback(hObject, eventdata, handles)
handles.from=str2double(get(hObject, 'String'));
guidata(hObject,handles);
function From_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function To_Callback(hObject, eventdata, handles)
handles.to=str2double(get(hObject, 'String'));
guidata(hObject,handles);
function To_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function Zoomb_Callback(hObject, eventdata, handles)
minY=min(str2double(get(handles.Samplef, 'String')))*1000;
maxY=max(str2double(get(handles.Samplef, 'String')))*1000;
axes(handles.axes2);
axis([handles.from, handles.to, minY, maxY ]);
Error using set Bad property value found. Object Name : axes Property Name : 'YLim' Values must be increasing and non-NaN.
Error in axis>LocSetLimits (line 208) set(ax,...
Error in axis (line 94) LocSetLimits(ax(j),cur_arg);
Error in M_player>Zoomb_Callback (line 202) axis([handles.from, handles.to, minY, maxY ]);
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in M_player (line 42) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)M_player('Zoomb_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback