Hy, I would like to know how to get vector output from the function?
for example
x = 0.5
y = 1
f = (1/2)*(x + y ) and out i want:
{answer}
{answer}
i try this:
f = inline('(1/2)*(x + y ) ')
[u v ] = f(x,y) but this doesnt work

 採用された回答

Wayne King
Wayne King 2013 年 11 月 2 日

0 投票

Why would you expect a vector out of that equation? That equation is of the form
z = f(x,y)
It is producing a scalar (real or complex) for any pair of scalar inputs.
If you want a vector output, you would have to put in a vector
x = [0.5 ; 0.5];
y = [1 ; 1]
f = 1/2*(x+y)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

タグ

質問済み:

x y
2013 年 11 月 2 日

コメント済み:

2013 年 11 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by