Back to the main page.

Bug 398 - the function isstr is still being used, although it is deprecated by matlab

Status CLOSED FIXED
Reported 2011-01-13 12:07:00 +0100
Modified 2011-02-23 13:51:07 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P1 normal
Assigned to: Arjen Stolk
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2011-01-13 12:07:43 +0100

ischar should be used instead of isstr manzana> grep isstr *.m */*.m */*/*.m besa2fieldtrip.m:if isstruct(input) && numel(input)>1 besa2fieldtrip.m:if isstruct(input) besa2fieldtrip.m:end % isstruct || ischar besa2fieldtrip.m:if isstruct(input) && isfield(input,'datafile') besa2fieldtrip.m:elseif isstruct(input) && ~isfield(input,'datafile') ft_analysisprotocol.m: if isstruct(thisname) ft_analysisprotocol.m: if isstruct(datacfg.previous) ft_connectivityanalysis.m: if isfield(data, 'labelcmb') && ~isstruct(powindx), ft_electroderealign.m: if isstruct(cfg.template{i}) ft_electroderealign.m: if isstruct(cfg.headshape) && isfield(cfg.headshape, 'pnt') ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_s1 = rand * 2 *pi; else phase_s1 = cfg.s1.phase; end ft_freqsimulation.m: if isstr(cfg.s2.phase); phase_s2 = rand * 2 *pi; else phase_s2 = cfg.s2.phase; end ft_freqsimulation.m: if isstr(cfg.s3.phase); phase_s3 = rand * 2 *pi; else phase_s3 = cfg.s3.phase; end ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_AM = rand * 2 *pi; else phase_AM = cfg.s1.phase; end ft_freqsimulation.m: if isstr(cfg.s2.phase); phase_high = rand * 2 *pi; else phase_high = cfg.s2.phase; end ft_freqsimulation.m: if isstr(cfg.s3.phase); phase_DC = rand * 2 *pi; else phase_DC = cfg.s3.phase; end ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_low = rand * 2 *pi; else phase_low = cfg.s1.phase; end ft_freqsimulation.m: if isstr(cfg.s2.phase); phase_high = rand * 2 *pi; else phase_high = cfg.s2.phase; end ft_freqsimulation.m: if isstr(cfg.s3.phase); phase_DC = rand * 2 *pi; else phase_DC = cfg.s3.phase; end ft_freqsimulation.m: if isstr(cfg.s4.phase); phase_AM = rand * 2 *pi; else phase_AM = cfg.s4.phase; end ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_s1 = rand * 2 *pi; else phase_s1 = cfg.s1.phase; end ft_freqsimulation.m: if isstr(cfg.s2.phase); phase_s2 = rand * 2 *pi; else phase_s2= cfg.s2.phase; end ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_s1 = rand * 2 *pi; else phase_s1 = cfg.s1.phase; end ft_headmodelplot.m: if isstruct(cfg.headshape) && isfield(cfg.headshape, 'pnt') ft_layoutplot.m:if ~isstruct(cfg) && ~isempty(cfg), error('argument cfg must be a structure'); end; ft_layoutplot.m: if isstruct(cfg.layout) ft_megplanar.m: if isstruct(cfg.headshape) && isfield(cfg.headshape, 'pnt') ft_megrealign.m: if isstr(cfg.template{i}), ft_megrealign.m: elseif isstruct(cfg.template{i}) && isfield(cfg.template{i}, 'pnt') && isfield(cfg.template{i}, 'ori') && isfield(cfg.template{i}, 'tra'), ft_neighbourselection.m:if ~isstruct(sens) ft_prepare_layout.m:if isstruct(cfg.layout) && isfield(cfg.layout, 'pos') && isfield(cfg.layout, 'label') && isfield(cfg.layout, 'width') && isfield(cfg.layout, 'height') ft_prepare_layout.m:elseif isstruct(cfg.layout) && isfield(cfg.layout, 'pos') && isfield(cfg.layout, 'label') && (~isfield(cfg.layout, 'width') || ~isfield(cfg.layout, 'height')) ft_prepare_layout.m:elseif ~isempty(cfg.elec) && isstruct(cfg.elec) ft_prepare_layout.m:elseif isfield(data, 'elec') && isstruct(data.elec) ft_prepare_layout.m:elseif ~isempty(cfg.grad) && isstruct(cfg.grad) ft_prepare_layout.m:elseif isfield(data, 'grad') && isstruct(data.grad) ft_prepare_sourcemodel.m: elseif isstruct(cfg.mri) && ~isfield(cfg.mri, 'gray') ft_prepare_sourcemodel.m: elseif isstruct(cfg.mri) && isfield(cfg.mri, 'gray') ft_prepare_sourcemodel.m: if isstruct(cfg.headshape) && isfield(cfg.headshape, 'pnt') ft_sourcestatistics.m:if isstruct(stat) ft_spike_plot_raster.m: if ~isstruct(topData) || ~all(isfield(topData,{'avg' 'time' 'label'})) statistics_montecarlo.m:if isstruct(statobs) statistics_montecarlo.m: if isstruct(dum) statistics_montecarlo.m: if isstruct(statrand) connectivity/ft_connectivity_granger.m:elseif ~iscell(powindx) && ~isstruct(powindx) connectivity/ft_connectivity_granger.m:elseif isstruct(powindx) fileio/ft_read_header.m: if isstruct(thishdr) fileio/ft_read_header.m: if isstruct(hdr{i}) fileio/ft_write_event.m: if isempty(event_queue) || ~isstruct(event_queue) fileio/ft_write_headshape.m:if ~isstruct(bnd) forward/ft_compute_leadfield.m:if ~isstruct(sens) && size(sens,2)==3 inverse/dipole_fit.m:if nargin==4 && ~isstruct(sens) && isstruct(dat) inverse/dipole_fit.m:elseif nargin==5 && ~isstruct(sens) && isstruct(dat) matlabbatch/cfg_message.m: ~(isstruct(varargin{1}) && numel(varargin{1}) == 1 && ... matlabbatch/cfg_message.m: if isstruct(varargin{1}) matlabbatch/cfg_ui.m: if isstruct(udmodlist) matlabbatch/cfg_ui.m:if isstruct(fs) matlabbatch/cfg_util.m: (isstruct(varargin{1}) && ... matlabbatch/cfg_util.m: varargout{1} = isstruct(varargin{1}) && ... matlabbatch/cfg_util.m: if (nargin > nids+2 && isstruct(varargin{nids+2})) || nargin > nids+3 matlabbatch/gencode.m: if isstruct(item) matlabbatch/gencode.m: if isstruct(item) matlabbatch/gencode.m: if isstruct(item) matlabbatch/gencode.m: if ~isstruct(item) matlabbatch/gencode_substruct.m:if ~isstruct(subs) || ~all(isfield(subs, {'type','subs'})) matlabbatch/gencode_substructcode.m:if ~isstruct(subs) || ~all(isfield(subs, {'type','subs'})) plotting/ft_plot_mesh.m:if ~isstruct(bnd) && isnumeric(bnd) && size(bnd,2)==3 private/arrow.m:if (nargin>0 & isstr(varargin{1}) & strcmp(lower(varargin{1}),'callback')), private/arrow.m:if (nargin==1 & isstr(varargin{1})), private/arrow.m: if ~isstr(curarg) | sum(size(curarg)>1)>1, private/arrow.m: elseif strncmp(prop,'norm' ,4), if (isstr(val)), crossdir=val; else, crossdir=val*sqrt(-1); end; private/arrow.m:if ~isempty(ends) & isstr(ends), private/arrow.m:if ~isempty(ispatch) & isstr(ispatch), private/arrow.m: if ~isstr(in), return; end; private/arrow.m: if ~isstr(str), error([upper(mfilename) ' got an invalid Callback command.']); end; private/convert_event.m:elseif isstruct(obj) private/denoise_artifact.m:if nargin<3 || ~isstruct(state) private/dimnum.m:if(~isstr(dimord)||~isstr(dim))error('Both dimord and dim must be strings');end; private/expand_orthogonal.m:if ~isstr(method) private/mergeconfig.m:if ~isstruct(input) private/mergeconfig.m:if ~isstruct(default) private/prepare_mesh_headshape.m:if isstruct(cfg.headshape) && isfield(cfg.headshape, 'pnt') private/prepare_mesh_manual.m: if isstruct(cfg.headshape) && isfield(cfg.headshape, 'pnt') private/readmarkerfile.m: if ~isstr(l) private/statistics_wrapper.m:if isstruct(stat) private/volplot.m:if isstr(sel) & strcmp(sel, 'min') private/volplot.m:elseif isstr(sel) & strcmp(sel, 'max') private/volplot.m:elseif isstr(sel) & strcmp(sel, 'center') private/volplot.m:elseif isstr(sel) & strcmp(sel, 'interactive') private/volplot.m:elseif ~isstr(sel) && length(sel)==1 private/warp_error.m:if isstruct(target) public/ft_checkconfig.m: if ~isstruct(cfg(k).(fieldsorig{i})) && ~any(strcmp(fieldsorig{i}, ignorefields)) public/ft_checkconfig.m: elseif isstruct(cfg(k).(fieldsorig{i})); public/ft_selectdata.m:isdata = find(cellfun(@isstruct,varargin)); public/getsubfield.m:if ~isstr(f) public/keyval.m:% the following is faster than cellfun(@isstr, keys) public/printstruct.m:if isstruct(val) public/printstruct.m:elseif ~isstruct(val) public/rmsubfield.m:if ~isstr(f) public/setsubfield.m:if ~isstr(f) realtime/ft_realtime_fmriviewer.m:elseif isfield(hdr,'siemensap') && isstruct(hdr.siemensap) realtime/ft_realtime_signalviewer.m: if isstr(evt(i).type) && isempty(evt(i).type) realtime/ft_realtime_signalviewer.m: elseif isstr(evt(i).type) && isstr(evt(i).type) realtime/ft_realtime_signalviewer.m: elseif isstr(evt(i).type) && isnumeric(evt(i).type) fileio/private/encode_nifti1.m:if ~isstruct(H) fileio/private/getsubfield.m:if ~isstr(f) fileio/private/keyval.m:% the following is faster than cellfun(@isstr, keys) fileio/private/read_ced_son.m: if isstr(getfield(pars,fields{idx})), fileio/private/read_eeglabheader.m:if ~isstruct(filename) fileio/private/readmarkerfile.m: if ~isstr(l) fileio/private/rmsubfield.m:if ~isstr(f) fileio/private/setsubfield.m:if ~isstr(f) forward/private/getsubfield.m:if ~isstr(f) forward/private/keyval.m:% the following is faster than cellfun(@isstr, keys) forward/private/rmsubfield.m:if ~isstr(f) forward/private/setsubfield.m:if ~isstr(f) inverse/private/getsubfield.m:if ~isstr(f) inverse/private/keyval.m:% the following is faster than cellfun(@isstr, keys) inverse/private/rmsubfield.m:if ~isstr(f) inverse/private/setsubfield.m:if ~isstr(f) peer/private/keyval.m:% the following is faster than cellfun(@isstr, keys) public/private/fixsource.m: if ischar(element) || isstruct(element) public/private/fixsource.m:% elseif isfield(data, 'trial') && isstruct(data.trial) public/private/fixsource.m:% if isfield(data, 'trial') && isstruct(data.trial) public/private/pos2dim3d.m:if nargin==1 && ~issKILLSWITCHtruct(pos), public/private/pos2dim3d.m:elseif isstruct(pos),


Simon Oosthoek - 2011-01-13 12:20:13 +0100

Is this a question of sed 's/\<isstr\>/ischar/g' ? BTW, I would narrow it down like this: /home/common/matlab/fieldtrip $ grep -r '\<isstr\>' `find . -name '*.m' -type f` ./private/dimnum.m:if(~isstr(dimord)||~isstr(dim))error('Both dimord and dim must be strings');end; ./private/expand_orthogonal.m:if ~isstr(method) ./private/arrow.m:if (nargin>0 & isstr(varargin{1}) & strcmp(lower(varargin{1}),'callback')), ./private/arrow.m:if (nargin==1 & isstr(varargin{1})), ./private/arrow.m: if ~isstr(curarg) | sum(size(curarg)>1)>1, ./private/arrow.m: elseif strncmp(prop,'norm' ,4), if (isstr(val)), crossdir=val; else, crossdir=val*sqrt(-1); end; ./private/arrow.m:if ~isempty(ends) & isstr(ends), ./private/arrow.m:if ~isempty(ispatch) & isstr(ispatch), ./private/arrow.m: if ~isstr(in), return; end; ./private/arrow.m: if ~isstr(str), error([upper(mfilename) ' got an invalid Callback command.']); end; ./private/readmarkerfile.m: if ~isstr(l) ./private/volplot.m:if isstr(sel) & strcmp(sel, 'min') ./private/volplot.m:elseif isstr(sel) & strcmp(sel, 'max') ./private/volplot.m:elseif isstr(sel) & strcmp(sel, 'center') ./private/volplot.m:elseif isstr(sel) & strcmp(sel, 'interactive') ./private/volplot.m:elseif ~isstr(sel) && length(sel)==1 ./multivariate/external/murphy/hmm/mhmm_em.m:if ~isstr(varargin{1}) % catch old syntax ./multivariate/external/farquhar/tprod/orderTests.m:if( nargin<2 || isempty(Y) ) if(~isstr(X)) Y=randn(size(X)); else Y=[]; end;end ./multivariate/external/farquhar/tprod/orderTests.m:if ( isempty(X)||isstr(X) || isempty(Y)||isstr(Y) ) ./multivariate/external/farquhar/tprod/orderTests.m: if (isstr(X)) X=feval(X,randn(sz)); else X=randn(sz); end; ./multivariate/external/farquhar/tprod/orderTests.m: if (isstr(Y)) Y=feval(Y,randn(sz)); else Y=randn(sz); end; ./multivariate/external/farquhar/compKernel.m:if ( isstr(kerType) ) ./multivariate/external/farquhar/whiten.m:if ( isstr(alpha) ) if ~isemif any(merror([upper(mfilename) ' does not recognize ''' deblank(ispatch(min(find(mask)),:)) ''' as a valid ''Type'' value.'])end;,empout(~out) = x(~out);','r','FaceColor',[1 .5 1]);85 .85]);,'Ends',str2mat('both','stop','stop'));; %l->pend;arningsnt]; ./public/getsubfield.m:if ~isstr(f) ./public/keyval.m:% the following is faster than cellfun(@isstr, keys) ./public/rmsubfield.m:if ~isstr(f) ./public/setsubfield.m:if ~isstr(f) ./realtime/ft_realtime_signalviewer.m: if isstr(evt(i).type) && isempty(evt(i).type) ./realtime/ft_realtime_signalviewer.m: elseif isstr(evt(i).type) && isstr(evt(i).type) ./realtime/ft_realtime_signalviewer.m: elseif isstr(evt(i).type) && isnumeric(evt(i).type) ./forward/private/getsubfield.m:if ~isstr(f) ./forward/private/keyval.m:% the following is faster than cellfun(@isstr, keys) ./forward/private/rmsubfield.m:if ~isstr(f) ./forward/private/setsubfield.m:if ~isstr(f) ./inverse/private/getsubfield.m:if ~isstr(f) ./inverse/private/keyval.m:% the following is faster than cellfun(@isstr, keys) ./inverse/private/rmsubfield.m:if ~isstr(f) ./inverse/private/setsubfield.m:if ~isstr(f) ./ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_s1 = rand * 2 *pi; else phase_s1 = cfg.s1.phase; end ./ft_freqsimulation.m: if isstr(cfg.s2.phase); phase_s2 = rand * 2 *pi; else phase_s2 = cfg.s2.phase; end ./ft_freqsimulation.m: if isstr(cfg.s3.phase); phase_s3 = rand * 2 *pi; else phase_s3 = cfg.s3.phase; end ./ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_AM = rand * 2 *pi; else phase_AM = cfg.s1.phase; end ./ft_freqsimulation.m: if isstr(cfg.s2.phase); phase_high = rand * 2 *pi; else phase_high = cfg.s2.phase; end ./ft_freqsimulation.m: if isstr(cfg.s3.phase); phase_DC = rand * 2 *pi; else phase_DC = cfg.s3.phase; end ./ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_low = rand * 2 *pi; else phase_low = cfg.s1.phase; end ./ft_freqsimulation.m: if isstr(cfg.s2.phase); phase_high = rand * 2 *pi; else phase_high = cfg.s2.phase; end ./ft_freqsimulation.m: if isstr(cfg.s3.phase); phase_DC = rand * 2 *pi; else phase_DC = cfg.s3.phase; end ./ft_freqsimulation.m: if isstr(cfg.s4.phase); phase_AM = rand * 2 *pi; else phase_AM = cfg.s4.phase; end ./ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_s1 = rand * 2 *pi; else phase_s1 = cfg.s1.phase; end ./ft_freqsimulation.m: if isstr(cfg.s2.phase); phase_s2 = rand * 2 *pi; else phase_s2= cfg.s2.phase; end ./ft_freqsimulation.m: if isstr(cfg.s1.phase); phase_s1 = rand * 2 *pi; else phase_s1 = cfg.s1.phase; end ./ft_megrealign.m: if isstr(cfg.template{i}), ./peer/private/keyval.m:% the following is faster than cellfun(@isstr, keys) ./ft_prepare_sourcemodel.m: if isstr(cfg.mri) ./external/spm2/spm.m:if isstr(Modality) ./external/eeglab/binica.m:if ~isstr(data) % data variable given ./external/eeglab/binica.m: if isstr(nchans) | isstr(nframes) ./external/eeglab/binica.m:if isstr(data) ./external/eeglab/runica.m: if ~isstr(Keyword) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if ~isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if ~isstr(Value) ./external/eeglab/runica.m: if ~isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if isstr(Value) ./external/eeglab/runica.m: if ~isstr(Value) ./fileio/private/read_ced_son.m: if isstr(getfield(pars,fields{idx})), ./fileio/private/readmarkerfile.m: if ~isstr(l) ./fileio/private/getsubfield.m:if ~isstr(f) ./fileio/private/keyval.m:% the following is faster than cellfun(@isstr, keys) ./fileio/private/rmsubfield.m:if ~isstr(f) ./fileio/private/setsubfield.m:if ~isstr(f)


Simon Oosthoek - 2011-01-13 12:23:20 +0100

it seems that a command like: sed -i.bak '/\<isstr\>/ischar/g' might do the trick </p>

Arjen Stolk - 2011-01-26 16:22:22 +0100

Done manually as there is also a isstruct which might be caught by the isstr search. Did not have access to change this file though: external/eeglab/runica.m:


Robert Oostenveld - 2011-02-23 13:51:07 +0100

I closed all bugs that were in the RESOLVED/FIXED or otherwise RESOLVED state.