From: AMK on 2 Mar 2010 04:43 Has Matlab removed documentation and procedures for substring()? [code] datenum(strtrim(substring(fnames(n).name,10,25)),'yyyymmdd HHMMss'); [/code] This used to be part of a script that grabbed file names and created a timestamp. However... "?? Undefined function or method 'substring' for input arguments of type 'char'. >> help substring substring not found."
From: Walter Roberson on 2 Mar 2010 14:48 AMK wrote: > Has Matlab removed documentation and procedures for substring()? > [code] > datenum(strtrim(substring(fnames(n).name,10,25)),'yyyymmdd HHMMss'); > [/code] > > This used to be part of a script that grabbed file names and created a timestamp. However... > > "?? Undefined function or method 'substring' for input arguments of type 'char'. > >>> help substring > > substring not found." No, substring was not a Matlab- provided function (at least not in any of the toolboxes I know about.) However, if you are sure that that character range will exist in the string, then just change the code to datenum(strtrim(fnames(n).name(10:25)),'yyyymmdd HHMMss'); As, though, you have 15 characters of date formatting, and are extracting 16 characters, the strtrim will be acting to remove a single blank. If the blank is in a fixed position, you can simplify the code to either datenum(fnames(n).name(11:25),'yyyymmdd HHMMss') or datenum(fnames(n).name(10:24),'yyyymmdd HHMMss')
|
Pages: 1 Prev: Classification problem Next: Evaluate ROI detection with correlation |