フィルターのクリア

Multiplying Function Handles quad

1 回表示 (過去 30 日間)
sarngon
sarngon 2015 年 3 月 20 日
コメント済み: Torsten 2015 年 3 月 20 日
Hi Guys , When I run this code below I get Error using * Inner matrix dimensions must agree. So whats your solution for this .
Error in f8>@(w)bb(w)*cc(w) (line 31)
f3 =@(w)bb(w)*cc(w);
Thanks .
code:
bb=@(w) (((1+w/wr*l)*vi/ccons).^(k-1));
cc=@(w) (2.71.^((-((1+w/wr*l)*vi/ccons)).^k));
f3 =@(w)bb(w)*cc(w);

採用された回答

Torsten
Torsten 2015 年 3 月 20 日
f3 =@(w)bb(w).*cc(w);
Best wishes
Torsten.
  2 件のコメント
sarngon
sarngon 2015 年 3 月 20 日
Thanks ,
Can You explain why should I use dot there ?
Torsten
Torsten 2015 年 3 月 20 日
w is a vector, say w=(w1,w2,...,wn), and the value of your function to be integrated at positions
w=(w1,w2,...,wn) is
(bb(w1)*cc(w1),bb(w2)*cc(w2),...,bb(wn)*cc(wn))
Thus you must use elementwise multiplication to get
(bb(w1),bb(w2),...,bb(wn)).*(cc(w1),cc(w2),...,cc(wn))=
(bb(w1)*cc(w1),bb(w2)*cc(w2),...,bb(wn)*cc(wn)).
Best wishes
Torsten.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by