Code covered by the BSD License  

Highlights from
physunits module from FORTRAN

4.0

4.0 | 1 rating Rate this file 4 Downloads (last 30 days) File Size: 32.03 KB File ID: #13018

physunits module from FORTRAN

by Naor Movshovitz

 

15 Nov 2006 (Updated 23 Jun 2008)

A toolbox that handles dimensioned variables

| Watch this File

File Information
Description

The physunits toolbox is an attempt to confer dimensional "awareness" to the MATLAB environment. The motivation for this, as well as a suggested way to go about it, are explained in
% Petty, G.W., 2001: Automated computation and consistency checking of
physical dimensions and units in scientific programs. Software -
Practice and Experience (Volume 31, Issue 11, 19 June 2001)

The author of the same has also made available for download a FORTRAN90 module that implements this ides in the FORTRAN language. The module and paper can be downloaded from
http://rain.aos.wisc.edu/~gpetty/physunits.html

The physunits toolbox is based on the above module, and expands it, while trying to adhere consistently to MATLAB standards and practices.

The zip file contains:

@preal (directory) -
In MATLAB, classes are defined by a directory of the class name preceded by a @ sign. The @preal directory contains the preal class definition and methods. To use the preal class, the directory IMMEDIATELY ABOVE @preal should be added to the MATLAB path.

setUnits.m -
MATLAB .m file with predefined units and constants. See documentation for usage.

info.xml - Pointer to the html documentation file. Used by the MATLAB
help browser.

html (directory) -
Containing the html help and documentation files.

physunits.m - a function for switching the physunits on or off.

iceball.m - a short sample program that demonstrates the preal class.

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
25 Apr 2007 Riccardo Meldolesi

this toolbox seems pretty good. The list of overloaded matlab functions is pretty exhaustive.

A wish could be to have the possibility to type directly the unit name rather than access a subfield of the @preal class, for example:

aVariable = 12 * m

instead of:

aVariable = 12 * si.metre

I could suggest a couple ow ways to do it in a OO way.

A small improvement to an alreadyvery good piece of code.

Please login to add a comment or rating.
Updates
28 Dec 2006

Moved to category Utilities:Development environment

15 Nov 2007

Added functions:
plot
loglog
semilogy
semilogx

23 Jun 2008

Added a couple of overloaded functions
Fixed a dead link in documentation

Tag Activity for this File
Tag Applied By Date/Time
development environment Naor Movshovitz 22 Oct 2008 08:49:21
units physunits fortran Naor Movshovitz 22 Oct 2008 08:49:21

Contact us at files@mathworks.com