フィルターのクリア

How to get vector output?

1 回表示 (過去 30 日間)
x y
x y 2013 年 11 月 2 日
コメント済み: Azzi Abdelmalek 2013 年 11 月 2 日
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
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 2 日
Why u and v ?

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

採用された回答

Wayne King
Wayne King 2013 年 11 月 2 日
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 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by