0
我的下拉列表包含ff。字符串:低通,高通,帶通,阻帶。無論何時我選擇低通,下面的錯誤都會顯示。下面的代碼適用於其餘的。矩陣尺寸必須一致
我的目標是在選擇低通和高通時使edtCutoff2和txtRange不可見,但下面的代碼僅適用於高通。
錯誤:
Error using ==
Matrix dimensions must agree.
Error in untitled>popFreqResp_Callback (line 168)
if ((str == 'Stop Band') | (str == 'Band Pass') == 1)
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in untitled (line 42)
gui_mainfcn(gui_State, varargin{:});
Error [email protected](hObject,eventdata)untitled('popFreqResp_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
代碼段
function popFreqResp_Callback(hObject, eventdata, handles)
list=get(handles.popFreqResp,'String');
str=list{get(handles.popFreqResp,'Value')};
if ((str == 'Stop Band') | (str == 'Band Pass') == 1)
set(handles.edtCutoff2,'Visible','on');
set(handles.txtRange,'Visible','on');
else
set(handles.edtCutoff2,'Visible','off');
set(handles.txtRange,'Visible','off');
end
請參閱[這裏](http://stackoverflow.com/a/19870322/2778484)和[這裏](http://stackoverflow.com/a/19986318/2778484)。 – chappjc