1

I do not know what's wrong with the code. Here's the snippet.

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

The full details of error Error while evaluating uicontrol Callback

Subscript indices must either be real positive integers or logicals.

Error in untitled>popFreqResp_Callback (line 166) set(handles.edtCutoff2,'visible')= 'on';

Error in gui_mainfcn (line 96)
    feval(varargin{:});

Error in untitled (line 42)
    gui_mainfcn(gui_State, varargin{:});

Error in @(hObject,eventdata)untitled('popFreqResp_Callback',hObject,eventdata,guidata(hObject))


Error while evaluating uicontrol Callback
Lucius II.
  • 1,832
  • 12
  • 19
PaZa
  • 15
  • 2
  • 9
  • Also see [this question](http://stackoverflow.com/questions/20054047/subscript-indices-must-either-be-real-positive-integers-or-logicals-generic-sol) for [the generic solution to this problem](http://stackoverflow.com/a/20054048/983722). – Dennis Jaheruddin Nov 27 '13 at 15:41

1 Answers1

1

You have to use it like that:

set(handles.edtCutoff2,'Visible', 'on');
Lucius II.
  • 1,832
  • 12
  • 19