フィルターのクリア

Nesting the value of variable in fsolve?

3 ビュー (過去 30 日間)
Joon Jeon
Joon Jeon 2012 年 3 月 31 日
I am trying to nest a variable in function f(E). And thes variable, say V, is also a function of E.
For example,
V=exp(E(1))+E(2);
f=@(E) [E(1)+34*E(2); E(1)+(2+V*8)*E(2)]
The above code is hypothetical for better presentation for you.
If we run this kind of problem(I will fsolve it), it will show error such as E(1) and E(2) is not defined.
So if I code
syms E
then it will not deliver answer from function f.
What can you suggest when solving this problem?
ps. Again, above example is just an example. Thanks!
I love Matlab!!!

採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 3 月 31 日
use
V = @(E)exp(E(1)) + E (2);
F = @(E)[E (1) +34 * E (2), E (1) + (2 + V(E) * 8) * E (2)]
OR
F = @(E)[E(1) +34 * E(2), E(1) + (2 + (exp(E(1)) + E(2))*8)* E(2)]
  1 件のコメント
Joon Jeon
Joon Jeon 2012 年 3 月 31 日
Thanks, it worked!
Could you answer my another question if you don't mind?
Question Below:
http://www.mathworks.se/matlabcentral/answers/34089-can-i-use-this-result-after-fsolve

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by