Unit Conversion

版本 1.0.0.0 (1.7 KB) 作者: Anthony Kendall
A simple unit conversion function that is easily extended.
2.0K 次下载
更新时间 2008/1/10

查看许可证

There are a few other unit conversion functions out there, but most are structured in a rather unwieldy format and require the use of extended switch...case blocks. This one uses a very simple structured array table to convert between any set of units that differ by a multiplicative offset and/or an additive factor.

The code is extremely lightweight, and fully vectorized.

The user must specify the input units and, optionally, the output units. If no output units are specified, than SI units are output (using degrees Celsius for temperature).

Only a limited set of conversions are included, but adding new ones should be fairly trivial. I encourage anyone who has questions, comments, or additions to write me at kendal30 [at] yahoo [dot] com.

引用格式

Anthony Kendall (2024). Unit Conversion (https://www.mathworks.com/matlabcentral/fileexchange/15046-unit-conversion), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2007a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Unit Conversions 的更多信息
致谢

启发作品: Unit Conversion Tools

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0

I have added a new group of units to the function.

Also, I wrote the function to be able to handle any combination of cell, numeric, and structured arrays (i.e. nested versions of cell/structured arrays).