I get this error for a simple code
function f = fun(x)
f =2*x;
end
please help me

 採用された回答

Star Strider
Star Strider 2019 年 5 月 17 日

1 投票

You have to call your function as:
x = 42;
y = fun(x);
Simply using the ‘Run’ option by clicking the green arrow in the Editor will not work.

その他の回答 (0 件)

カテゴリ

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

タグ

質問済み:

2019 年 5 月 16 日

回答済み:

2019 年 5 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by