Code Directory
 Visual Basic & VB.NET
New Code
C# QR Code Generator
Salesforce WordPress Customer Portal 3.2.0
Single Leg MLM 1.2.1
OzGIS 14.6
Quick Maps For Dynamics CRM 3.1
Job Board Software 4.2
PHP Real Estate Script 1.3.2
IP2Location Geolocation Database April.2019
dbForge Data Generator for Oracle 2.1
VisualNEO Web 2018.12.15
SentiMask SDK Trial 1.0.0
OrgChart JS 4.6.4
dotConnect for BigCommerce 1.8
FedEx Smart Shipping For Magento 1.0.0
Database Workbench Pro
Top Code
Cuckoo Search (CS) Algorithm 1.0
MATLAB Support Package for Arduino (aka ArduinoIO Package) 1.0
Modbus RS232 ASCII Communication Functions 1.0
Job Board Software 4.2
Hyperion Tools 1.0
Emulator_8051 _8051
bit plane slicing 1.0
CardCheck COM DLL for Credit Card Processing 1.1
Efficient K-Means Clustering using JIT 1.0
webmoney - Webmoney payment gateway 5.x-1.2
Azizi search engine script PHP 4.1.10
Power System Stability and Control 1.0
NDRZilla NDR viewer
Image Cut (Image Splitter) 1.504
Comag Channel List Editor 1.0
Top Rated
VisualNEO Web 2018.12.15
Paste phpSoftPro 1.4.1
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
Availability Booking Calendar PHP 1.0
PHP GZ Blog Script 1.1
ATN Jobs Software 4.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: 14
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: 14

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