Mercurial > forge
changeset 12566:1d0ab462926e octave-forge
avoid obsolete strmatch function
author | abarth93 |
---|---|
date | Tue, 10 Mar 2015 20:58:29 +0000 |
parents | f22c1e4bc9c5 |
children | 560f9cfb5db9 |
files | extra/ncArray/NEWS extra/ncArray/inst/@ncBaseArray/subsref.m |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/extra/ncArray/NEWS Tue Mar 10 13:53:33 2015 +0000 +++ b/extra/ncArray/NEWS Tue Mar 10 20:58:29 2015 +0000 @@ -1,3 +1,8 @@ +Summary of important user-visible changes for ncarray 1.0.4: +------------------------------------------------------------ + + ** Avoid obsolete strmatch function + Summary of important user-visible changes for ncarray 1.0.3: ------------------------------------------------------------
--- a/extra/ncArray/inst/@ncBaseArray/subsref.m Tue Mar 10 13:53:33 2015 +0000 +++ b/extra/ncArray/inst/@ncBaseArray/subsref.m Tue Mar 10 20:58:29 2015 +0000 @@ -52,7 +52,10 @@ elseif strcmp(idx.type,'.') % load attribute name = idx.subs; - index = strmatch(name,{self.vinfo.Attributes(:).Name}); + % strmatch is obsolete + % index = strmatch(name,{self.vinfo.Attributes(:).Name}); + index = find(strcmp(name,{self.vinfo.Attributes(:).Name})); + if isempty(index) error('variable %s has no attribute called %s',self.varname,name);