unit

버전 3.21 (15.7 KB) 작성자: Christopher Pedersen
unit conversion with dimension check
다운로드 수: 374
업데이트 날짜: 2024/9/25

라이선스 보기

converts between different units, and checks that their dimensions are consistent
units may be compounds of other units (e.g. Newton-meters or meters/second)
units may have powers (e.g. meter^3 or m/s2)
units may have scaling prefixes (e.g. milimeters or kW)
examples:
unit('N-m','kg.m2/s2') %torque
unit('Pa','N/in2') %pressure
unit('m','s') %causes error because wrong dimensions
unit('kN/MPa','m^2') %works, because dimensions are correct.

인용 양식

Christopher Pedersen (2025). unit (https://kr.mathworks.com/matlabcentral/fileexchange/46045-unit), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2024a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
3.21

- Documentation updated for clarity
- Allows use of "none" : nondimensional unit with magnitude 1
- Nondimensional units are now reported as having dimensions "nondimensional", rather than just an empty string.

3.2

Fixed bug where some compound units did not resolve correctly.
Added more units.

3.1.0.0

Bug fixed: negative prefixes became positive (e.g. mm became 1E3 m rather than 1E-3m).
Added units for magnetic fields: weber, siemen, tesla, gauss

3.0.0.0

Added handling of nondimensional units.
Added units 'slug','kph' and 'henry'
Added 'reltemp' option to supress warning when converting temperatures
under-the-hood changes to how unit terms are handled.
Additional help on units and options

2.6.0.0

added: allows nondimensional units
fixed: was not parsing 'mm' (milimeters) correctly
added: error message when cannot parse the power of a term

2.4.0.0

added 'detail' option that shows how each term of each unit is parsed

2.3.0.0

'verb' option gives additional reporting at each step (scale and power)
fixed 'verb' reporting : was misreporting original scale (calculation was okay)

2.2.0.0

Corrected unit pound (weight) - was missing the last digit
fixed error when handling unrecognised units

2.1.0.0

Added definitions of Calorie and FoodCalorie
Ounce definition was 1000 times too small, fixed.

2.0.0.0

Added additional units (lightSpeed, horsepower, etc).
Fixed spelling of celsius unit
Divisor "/" now affect only the single following term, rather than all following terms.
Additional reporting of units grouped by type, using "unit report".

1.4.0.0

Fixed misspelling of unit "celsius"

1.3.0.0

Added ability to use custom units.

1.2.0.0

Added absolute temperature conversion.
Fixed bug where prefix+symbol name not recognised (e.g. kohm or mvolt

1.1.0.0

New: allows a single input instead of two. Does not perform a conversion, instead just reports that one unit.
New: Reports base units of each input

1.0.0.0