Code Directory
 Visual Basic & VB.NET
New Code
Spire.PDF for Java 2.7.8
Database Workbench Pro
The C# PDF Library 2020.1.5
dotConnect for SQLite 5.15
LuaStudio 9.92
EntityDAC 2.3
Devart ODBC Driver for QuickBooks 2.0
phpEnter 5.1.
Udemy Clone script 2.01
VisualNEO Web 19.11.7
VisualNEO for Windows
SentiVeillance SDK Trial 7.3
Devart ODBC Driver for PostgreSQL 3.2
SecureBridge 9.2
Top Code
SecureBridge 8.0
dotConnect for SQLite 5.9
EntityDAC 1.6
Database Workbench Pro
ATN Site Builder 3.0
ATN Resume Finder 2.0
The C# PDF Library 1.0
SentiVeillance SDK Trial 7.3
PHP Review Script 1.0
ICPennyBid Penny Auction Script 4.0
Invoice Manager by PHPJabbers 3.0
Devart ODBC Driver for PostgreSQL 3.2
ADO.NET Provider for ExactTarget 1.0
Deals and Discounts Website Script 1.0.2
Aglowsoft SQL Query Tools 8.2
Top Rated
phpEnter 5.1.
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Automatic UNITS conversion 1.0
File ID: 79509

Automatic UNITS conversion 1.0
Download Automatic UNITS conversion 1.0http://www.mathworks.comReport Error Link
License: Freeware
File Size: 10.0 KB
Downloads: 17
Submit Rating:
Automatic UNITS conversion 1.0 Description
Description: Eliminate UNITS related errors in code, through automatic units conversion

A UNIT class is defined to automatically perform units conversion into the MKS system (metre,kg,sec).

I aim to solve the problem of using, say, mm instead of m, or converting mm to inches.
This is also a problem during plotting, because of the need to keep track of the units
of what is being plotted.

For this reason I like to define all variables into the MKS system by writing:

diameter = 10.0 * mm;

This is an automatic conversion into MKS, while still allowing me to think in mm (or grams, N, inches ...)

If the value of mm is 1e-3, then the value of diameter is 1e-2, which, experessed in
metres is = 10 mm. (everything is fine)

From this point onward all the calculations that use 'diameter' can be done in the MKS,
avoiding any "order of magnitude error". The syntax above is also particularly useful in
input files where a lot of scalar parameters are defined. It provides a lot of
information at a glance.

When a variable needs to be displayed or plotted the following syntax can be used:




Also it is possible to perform units conversions in functions or on the command line.
For example the following statement converts 10 mm into inches

>> 10 * mm/in
ans =

all of this is not a my invention, being in use in at least another software. I adopted
it because for me it works very well.

This new submission allows to create composite units, like:

typing: kg/mm^3
will display: kg/(mm^3) = 1.000000e+009

in this case the class returned variable is 'COMPOSITEUNIT'

Other examples:
typing: kg*m/sec^2 / (kg/mm^3)
will display: kg*m/(sec^2)/(kg/(mm^3)) = 1.000000e-009

in this case the class returned variable is 'COMPOSITEUNIT'

kg*m/(sec^2) = 1.000000


To implement the syntax above I created a class called 'unit', which must be saved into
a directory called 'unitClasses'. The directory 'unitClasses' must be added to the

The function 'unitClasses@unitprivategetStructure.m' contains a comprehensive list of
units, which can be extended as suitable.

Then by calling the method 'update(unit)', a number of classes will be created, one for
each of the units defined in 'getStructure'.

You might then have to type:

'clear classes'
'rehash toolbox'

the updating can be done at any time a new unit is added to the function 'unitsList'.
from now on every time a syntax like 'diameter = 10.0 * mm;' is used a unit conversion
is made.

More info in the README.txt file

Your feedback is welcome

License: Freeware

Related: kgmm, 1000000e2b009in, returned, Display, Create, Composite, liketyping, compositeunit, examplestyping, installationto, implement, created, 1000000e009in, kgmsec, kgmsec kgmm, Submission, Statement

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 17

More Similar Code

Easy Args java command line processing API is designed using annotations and reflection to greatly simplify the tasks involved in argument processing, including required argument detection, automatic type conversion, and the generation of usage help.

ABF Value Converter is an application for measurement units conversion. This software easily converts various measurement values into any other possible ones. Inches to centimetres, pounds to kilograms, Fahrenheit to Celsius... and more than 5000...

Have you ever needed to convert horse power to watts but can't remember the conversion factor? How many inches light travels in a microsecond? This toolbox is designed to make getting these answers much easier.

The "unit"...

This Perl script allows users to convert a wide range of units such as energy, pressure, volume, density, entropy, enthalpy, specific volume, viscosity, and more.

XSH2 is a powerfull command-line tool for querying, processing and editing XML documents. It features a shell-like interface with auto-completion for comfortable interactive work, but can be as well used for off-line (batch) processing of XML...

This is a java applet where the users have the capability to change the numbers from one unit of measure to another. The users can setup their own data files with multiplier prefixes, units categories, units definitions and preferable languages....

DBLIB is a PHP library to create WWW interfaces to databases. It's main aim is to support creating interfaces for site administrators (so called "admin systems"), but it can be used as well to create public (end-user) interfaces.

Loris Hotels Reservation System is a result of 2 years research and development by Lithuanian Tourism Organization "Tourism Fund of Lithuania" and Loris development team. The system integrates a business model of operating such service...

To automatically convert from one units base to another, select the conversion type from the pull down menu box. Input the magnitude of the input units in the text box in the inputs section. Select the input units in the list box in the inputs...

Units API converts between various weights and measurements.

The central API call, unitsapi_convert($value, $from, $to, $details = FALSE), uses the International System of Units (SI) conversion factors to convert measurement units.

User Review for Automatic UNITS conversion
- required fields

Please enter text on the image