± use in MATLAB

4 ビュー (過去 30 日間)
Priyank Goel
Priyank Goel 2021 年 2 月 27 日
編集済み: Star Strider 2021 年 2 月 27 日
CL = (0.331±0.008) + (0.15±0.002)*ALPHA
I have to code this equation in MATLAB but don't know, how can I code this?
Thanks!

回答 (2 件)

Star Strider
Star Strider 2021 年 2 月 27 日
One option:
CL = [(0.331+0.008) + (0.15+0.002)*ALPHA
(0.331-0.008) + (0.15-0.002)*ALPHA];
Experiment to get different results, depending on how you want to define the equations.
  4 件のコメント
Priyank Goel
Priyank Goel 2021 年 2 月 27 日
Thanks for the answer,
Is there any other way as writing the complete equation 4 times can be little tedious?
Star Strider
Star Strider 2021 年 2 月 27 日
編集済み: Star Strider 2021 年 2 月 27 日
It’s quite possible to make this ridiculously complicated.
The easiest option is likely:
CL = [0.331 0.15] + [0.008 0.002].*[1 1; 1 -1; -1 1; -1 -1];
and just let it go at that.
EDIT — (27 Feb 2021 at 22:04)
Those are obviously only the limits, according to whatever criteria you wish to apply to them. Use them appropriately in your code.

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


Walter Roberson
Walter Roberson 2021 年 2 月 27 日
syms ALPHA
syms delta_1 delta_2
assume(-0.008 <= delta_1 & delta_1 <= 0.008)
assume(-0.002 <= delta_2 & delta_2 <= 0.002)
CL = 0.331 + delta_1 + (0.15+delta_2)*ALPHA
CL = 
expand(CL)
ans = 
The matrix approach is not correct, as it gives specific values, whereas you need a range of values. For example you might have 1/(CL-0.15*ALPHA-0.331) as part of an expression, and if you only work with the edge cases you miss the fact that this passes through 1/0 .

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by