Code covered by the BSD License  

Highlights from
MOtion DEcision (MODE) model

image thumbnail
from MOtion DEcision (MODE) model by Massimiliano Versace
MOtion DEcision (MODE) model is a neural model of perceptual decision-making.

editBoxEnable(handles,data,status,varargin)
function editBoxEnable(handles,data,status,varargin)
% function editBoxEnable(handles,data,status,varargin)
% Purpose: Modify the edit boxes' 'Enable' status
% handles: handles of all GUI tools used
% status: 'On' or 'Off'
% varargin specifies which edit boxes to change the status.
% For example, [1:6 22 23] (motion panel only) or [1:20 22 23]
% to change the status for all defined boxes. The order is not
% relevant. The fact that the not all edit boxes are defined is
% the reason behind writing this function.
if nargin-3 == 0
  for i=1:length(data.tag)
    eval(['set(handles.' data.tag{i} ', ''Enable'', status)']);
  end
else
  j = 0;
  for i=varargin{1}
    j = j + 1;
    eval(['set(handles.' data.tag{j} ', ''Enable'', status)']);
  end
end

Contact us at files@mathworks.com