CHANGEUNIT (converts between units).
Updated 5 Jan 2005

No License

CHANGEUNIT(x,'unit1','unit2') - Converts array x from physical unit1
to unit2
Example: changeunit(1,'in','mm') = 25.4

This is a very compact/fast/simple version of units.m(by Henning Ressing) which has been very useful to me but is not very easy to read because of a flood of switch-case statements.

Cite As

Mukhtar Ullah (2024). CHANGEUNIT (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Convert Image Type in Help Center and MATLAB Answers

Inspired by: Units (updated)

Inspired: Unit Conversion Tools

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

compact code