我想給用戶2分,並顯示這些點之間的光譜圖,我成功地使用下面的代碼,但我不知道爲什麼讓我下面的錯誤?凸輪我如何在我的代碼中水平放大光譜圖?
另外我想知道,如果我想在我的代碼中放置一個重置按鈕,以將繪圖恢復到初始狀態,我該怎麼做?
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 ]);
使用集錯誤 找到了不良的屬性值。 對象名稱:座標軸 屬性名稱:'YLim' 值必須增加且非NaN。
錯誤軸線> LocSetLimits(線208) 集(AX,...
錯誤軸線(線94) LocSetLimits(AX(j)中,cur_arg);
錯誤M_player > Zoomb_Callback(線202) 軸([handles.from,handles.to,MINY,MAXY]);
錯誤gui_mainfcn(線96) feval(varargin {:});
錯誤M_ player(line 42) gui_mainfcn(gui_State,varargin {:});在評估中 @(hObject,EVENTDATA)M_player( 'Zoomb_Callback',hObject,EVENTDATA,guidata(hObject))
錯誤
錯誤uicontrol回調
那麼在調用軸時(y軸的極限是minY到maxY,它們是**是相同的**),因此您會收到錯誤消息。 minY or maxY? – 2014-12-05 20:46:49
謝謝。我只想要x軸縮放比例變化,並提醒它縮放,但不知道我該怎麼做! 我試圖從光譜圖中得到y尺度,但沒有成功:( – user3305284 2014-12-05 21:33:35