フィルターのクリア

when i run the following code its showing an error that dimensions must agree

1 回表示 (過去 30 日間)
vaishnavi potharaju
vaishnavi potharaju 2018 年 12 月 11 日
編集済み: madhan ravi 2018 年 12 月 12 日
w=(2.3.^-u.*log(1.+(0.5615./u)-0.4385*(((1.0421.*u))+(1/(1.+u.^1.5))+(1.0801./(1.+(2.35.*u.^(-1.0919))))))^-2./(0.5616+(0.4385+2.35.*2.3^(-2.283.*u))))
i want to calculate 'w' for a set of 'u' values.i'm confused while arranging '.' when i run this i get "error usin + and matrix dimensions must agree".

採用された回答

madhan ravi
madhan ravi 2018 年 12 月 11 日
編集済み: madhan ravi 2018 年 12 月 11 日
If you still have problem then use bsxfun() with mtimes and rdivide appropriately if your usig version prior to 2016b
w=(2.3.^-u.*log(1.+(0.5615./u)-0.4385.*(((1.0421.*u))+(1/(1.+u.^1.5))+(1.0801./(1.+(2.35.*u.^(-1.0919))))))^-2./(0.5616+(0.4385+2.35.*2.3^(-2.283.*u))))
^---dot missed
  5 件のコメント
madhan ravi
madhan ravi 2018 年 12 月 11 日
Anytime :)
vaishnavi potharaju
vaishnavi potharaju 2018 年 12 月 12 日
編集済み: madhan ravi 2018 年 12 月 12 日
sir i tried to run my code with bsxfnc but as it is a very complex equation i couldnt do it.so i split the equation into small parts as follows and now im able to run it.
w=((2.3).^-u.*log(1.+(0.5615./u)-0.4385.*(((1.0421.*u))+(1./(1.+u.^1.5))+(1.0801./(1.+(2.35.*u^(-1.0919)))))).^-2./(0.5616+(0.4385*2.3.^(-2.2803.*u))))
w1=1.+(0.5615./u)
w2=1.0801./(1.+(2.35.*u.^(-1.0919)))
w3=1./(1.+u.^1.5)
w4=1.0421.*u
w5=2.3.^-u
w6=0.4385.*2.3.^(-2.2803.*u)
w7=0.4385.*(w4+w3+w2).^-2
w8=log(1+w1-w7)
w9=w8.*w5
w10=0.5616+w6
wu=w9./w10

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by