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 Exchange에서 Just 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