Rank: 263 based on 388 downloads (last 30 days) and 13 files submitted
photo

Stephen Cobeldick

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Stephen View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Jul 2014 Screenshot Numeric to English Words Convert a numeric scalar to a string giving the English name of the number value (GB/US). Author: Stephen Cobeldick dialect, words, number names, cheque, check, string 39 0
14 Jul 2014 Screenshot Prefixed-String Conversion (SI or Binary) Convert between numeric values and SI (or binary) prefixed strings. Author: Stephen Cobeldick data, communications, iso 80000, bytes, engineering, si 50 0
02 Jul 2014 Customizable Natural-Order Sort Natural-order sort of a cell array of strings, with customizable numeric format. Author: Stephen Cobeldick natural order, sort, cell of strings, string manipulation, customizable, regexp 43 0
26 Jun 2014 TimeStr String representation of time in HH:MM:SS.SSSS format. Author: Stephen Cobeldick time, date, datenum, hours, minutes, seconds 21 0
18 Apr 2014 Screenshot Numeric to Ordinal-String Convert numeric values to a character array of integers with ordinal suffixes (numeric -> string). Author: Stephen Cobeldick ordinal, suffix, int2str, num2str, cardinal, vectorize 25 0
Comments and Ratings by Stephen View all
Updated File Comments Rating
30 Jul 2014 doc2pdf.m Convert DOC or DOCX file to PDF Author: Daniel Pereira

I am impressed with your prompt response. The submission now has a nice help section and returns values to indicate the conversion success. It does exactly what it says on the box.

When tested on my Win7 + Office it produced a warning dialogue from MS Office about the document already being opened by "another user"... but the conversion succeeded anyway.

23 Jul 2014 doc2pdf.m Convert DOC or DOCX file to PDF Author: Daniel Pereira

Nice idea, with clearly written code. However the M-file itself is without any help section, examples, H1 line, or comments. Some input checking is probably required, and if possible an output giving the operation success status.

23 Jul 2014 Untitled.m This is program to find out the boundary of a fig Author: anku

Please give your submission (and M-file) a more informative title than "Untitled.m".

You might get some more people looking at your submission with a bit of effort on presentation: an introduction explaining exactly what it does and some examples would be an absolute minimum. Information on the algorithm and the intended area of use is even better.

18 Jul 2014 sci2num Converts a string with (possibly) an SI prefix to a number. Works in reverse of num2sci. Author: Jason Kaeding

Disclaimer: In the end I could not find any FEX submission that gave the correct outputs for the wide range of test-cases that I tried, so I ended up writing my own function. You can find it here:
http://www.mathworks.com/matlabcentral/fileexchange/33174

18 Jul 2014 sci2num Converts a string with (possibly) an SI prefix to a number. Works in reverse of num2sci. Author: Jason Kaeding

This submission is a simple and rugged solution to the problem of converting from an SI prefixed string into a numeric. The code concept is very neat, only failing to convert a few of the strings that I tested with, such as combinations of E-notation and prefixes (eg: '1e3 k' -> NaN), and 'Inf' values that also turn into NaNs. It includes some examples and a nice help section, but no H1 line. There are a few "mlint" messages that need attention, but basically it is a good addition to FEX.

Comments and Ratings on Stephen's Files View all
Updated File Comment by Comments Rating
26 Jun 2014 Date Vector/Number to ISO 8601 Date String Convert a Date Vector/Number to an ISO 8601 Date String. Tokens control the date/time notation. Author: Stephen Cobeldick Long

Thanks a lot. A very useful subroutine.

20 Jun 2014 ISO 8601 Date String to Serial Date Number Convert an ISO 8601 Date String to Serial Date Numbers. Auto-detect or select timestamp style. Author: Stephen Cobeldick Cobeldick, Stephen

Jorge: thank you for your feedback. Multirow char array parsing can also be achieved in one line, using your example char array:
cellfun(@datenum8601,cellstr(t))
If any of the rows might contain multiple dates (or no date!):
cellfun(@datenum8601,cellstr(t),'UniformOutput',false)

Note that your example strings have six decimal digits: serial date numbers are stored in MATLAB as a double, limiting the absolute precision, as do MATLAB's date conversion functions too. Up to four decimal digits seem to be reliably converted, although the documentation only mentions milliseconds.

Currently the function only accepts a single string input (i.e. a char array of size 1*N). The design decision to not parse multirow char arrays (or cell arrays of strings) is one that I put considerable thought into. It is important to note that multiple dates are possible in the string (or possibly none!). If multirow char arrays were able to be parsed, then:
- if the converted date numbers are returned in a numeric array, then it would need to be padded with zeros (and as MATLAB has no NA value, an index of the valid entries would also be required),
- else if the converted date numbers are returned in a cell array (one cell per row), then this requires an untidy special case for char arrays of one row (as most users would expect a simple string to return the date number, and not a scalar cell array containing the date number).

Ultimately the end-user is in the best position to know what kind of strings they have (e.g. your examples with one date per string and no split parts), and as a result also to know how they want to collect the output date numbers together (e.g. in a numeric vector given one date per string, or in a cell of vectors given multiple dates per string). All of these points also must be considered with respect to the string split parts and date format tokens too...

19 Jun 2014 ISO 8601 Date String to Serial Date Number Convert an ISO 8601 Date String to Serial Date Numbers. Auto-detect or select timestamp style. Author: Stephen Cobeldick Jack

Does what it says on the tin.

31 May 2014 ISO 8601 Date String to Serial Date Number Convert an ISO 8601 Date String to Serial Date Numbers. Auto-detect or select timestamp style. Author: Stephen Cobeldick Jorge

Great! However, I wasn't able to make it run (without a loop I mean) with multirow chars like this :

t =

2014-02-01T23:55:04.284002Z
2014-02-02T23:55:04.161520Z
2014-02-03T23:55:04.348627Z
2014-02-04T23:55:03.517715Z

I think it could be a good addition! (Or maybe I'm doing it wrong!)

16 Apr 2013 Round Serial Date Numbers or Date Vectors Round Serial Date Numbers or Date Vectors to the nearest desired unit (round/floor/ceiling). Author: Stephen Cobeldick Harris, Jeff

Nicely done. It is useful to have a time rounding fn to determine if times are equal within a tolerance, especially if they may have lost significant digits.

Contact us