フィルターのクリア

how to use MATLAB units ?

3 ビュー (過去 30 日間)
timo
timo 2016 年 3 月 10 日
編集済み: Karan Gill 2017 年 10 月 17 日
I need to use units in Matlab
To use Matlab units i use Mupad like this:
aux1 = evalin(symengine,'unit::convert(2.1*unit::volt, unit::mvolt)')
Which returns
2100.0*unit::mvolt
Is there any way to use units beside this hack , which is quite annoying ...

採用された回答

Karan Gill
Karan Gill 2017 年 3 月 10 日
編集済み: Karan Gill 2017 年 10 月 17 日
Starting R2017a, units are available in MATLAB via Symbolic Math Toolbox. See:
Karan. (Symbolic doc)
[SL: fixed typo.]

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2016 年 3 月 10 日
Other than switching to feval() syntax, No.
  5 件のコメント
timo
timo 2016 年 3 月 14 日
編集済み: timo 2016 年 3 月 14 日
Anyway sym syntax is fine by me
I marked my answer as the solution.
Walter Roberson
Walter Roberson 2016 年 3 月 15 日
aux1 = feval(symengine, 'unit::convert', 2.1 * V, mV)

サインインしてコメントする。


timo
timo 2016 年 3 月 13 日
編集済み: timo 2016 年 3 月 14 日
Well to reduce some extratyping this shall help :)
MUPAD = @(x) sym(x);
Then use like MUPAD('unit::ohm')
The better solution is thanx to Walter's suggestion is to use sym keyword and then the string for Mupad units. I will see how it gets me

カテゴリ

Help Center および File ExchangeUtilities for the Solver についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by