Rank: 4870 based on 2 downloads (last 30 days) and 2 files submitted
photo

Dave Ciochetto

E-mail
Company/University
Dalhousie University

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Dave View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
30 Jun 2006 vernum.m vernum - returns the current version of Matlab as a number Author: Dave Ciochetto path, directories, files, matlab version number... 0 7
  • 3.0
3.0 | 7 ratings
22 Jun 2006 Screenshot ellipseaxes.m Add lines for the major and minor axes on an ellipse, returns the handles for post customization Author: Dave Ciochetto annotation, customization, ellipse, axes, major axis, minor axis 2 1
Comments and Ratings on Dave's Files View all
Updated File Comment by Comments Rating
12 Apr 2010 vernum.m vernum - returns the current version of Matlab as a number Author: Dave Ciochetto Simon, Jan

For 2010a this replies 7.10, which equals 7.1!
Faster and simpler (and less than 2 lines):
  VersionNumber = sscanf(version, '%f', 1)
But this fails for v7.10 also, but this get catch it:
  [10000, 100, 1] * sscanf(version, '%d.', 3)
e.g. 6.5.1 => 60501. This is monotonically increasing and unique - but still just another strange method.

01 Nov 2007 vernum.m vernum - returns the current version of Matlab as a number Author: Dave Ciochetto Davis, Tim

Jos's comment about computing vernum will work on any MATLAB that has struct's. However, the whole point of a function like this is that it must work on very old MATLAB releases, including very old MATLAB's that do not have structs.

I think the .Version field returned from ver might be a string of the form 'A.B.C', in which case Jos' suggestion will fail completely.

In any case, "ver" is about 100 times slower than "version" (try it), an important consideration if this code is called inside a heavily-called function. That critique applies to the new "verLessThan" function in MATLAB, too, by the way.

So a well-written code, like this, must not use "ver".

The "version" function is likely to exist on much older MATLAB releases than "ver", since the former does not use structs.

The real question, though is this: will this code work on MATLAB 1, 2, 3, 4, 5, ...? How far back has it been tested?

I rate it a 4 because the code should be cleaned up a bit, the comments ("see also", for example) are lacking, and (mostly) because it isn't clear from the documentation how far back the code has been tested. It would also be nice to be able to distinguish between 7.0.1 and 7.0.4.

I have to strongly disagree with Sergei's comment. The real usefulness of this code is that it can (or at least should) be written *very* carefully so that it will run on, say, MATLAB 3. Assuming that has been done, that makes this code useful for those of us who no longer have a copy of MATLAB 3.

Getting these 2 lines right is *not* a trivial thing, as Sergei claims it to be.

22 Jul 2006 vernum.m vernum - returns the current version of Matlab as a number Author: Dave Ciochetto Hah, AnonToYou

Will the proposed 'simpler' solution from Jos work for the first version of Matlab I used ... ???
5.2.1.1420

12 Jul 2006 ellipseaxes.m Add lines for the major and minor axes on an ellipse, returns the handles for post customization Author: Dave Ciochetto Ciochetto, Dave

Obsolete now. Use ellipse.m

05 Jul 2006 vernum.m vernum - returns the current version of Matlab as a number Author: Dave Ciochetto Koptenko, Sergei

1) There are infinite number of simple useful two-liners that can be created in Matlab. Add to that an equal number of three and four-liners and you will see how FEX becomes a huge pile of ?simple but useful? junk.
2) Anonymous comments ought to be ignored by default. Serious participants have no reason to hide its face. We are not dealing drugs here.

Top Tags Applied by Dave
annotation, axes, customization, directories, ellipse
Files Tagged by Dave View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
30 Jun 2006 vernum.m vernum - returns the current version of Matlab as a number Author: Dave Ciochetto path, directories, files, matlab version number... 0 7
  • 3.0
3.0 | 7 ratings
22 Jun 2006 Screenshot ellipseaxes.m Add lines for the major and minor axes on an ellipse, returns the handles for post customization Author: Dave Ciochetto annotation, customization, ellipse, axes, major axis, minor axis 2 1

Contact us at files@mathworks.com