This is my function file:
function ellipseplot(xc,yc,a,b) ((xc^2))/((a^2))+((yc^2))/((b^2)); end
And this is my script file where I call the function:
fplot('ellipseplot(3.5,2.0,8.5,3)',[-20,20]) figure(1)
However, whenever I execute the script file, it throws up a bunch of errors. What am I doing wrong? Thanks.

1 件のコメント

Jeffrey
Jeffrey 2014 年 10 月 13 日
The errors are as follows:
Error using inlineeval (line 14) Error in inline expression ==> ellipseplot(3.5,2.0,8.5,3) Too many output arguments. Error in inline/feval (line 33) INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr); Error in fplot (line 101) x = xmin; y = feval(fun,x,args{4:end}); Error in Functions_1_HW (line 24) fplot('ellipseplot(3.5,2.0,8.5,3)',[-20,20])

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

 採用された回答

Image Analyst
Image Analyst 2014 年 10 月 13 日

0 投票

3 件のコメント

Jeffrey
Jeffrey 2014 年 10 月 13 日
I haven't seen the FAQ. Will my code run properly if I follow the instructions on the page?
Jeffrey
Jeffrey 2014 年 10 月 13 日
I'm looking to fix my function so that, when I call it, it will work properly.
Image Analyst
Image Analyst 2014 年 10 月 13 日
Your function does not return anything whatsoever. Nothing. Moreover, it doesn't even do any plots inside of it. It's merely an expression that gets evaluated - that's all. It doesn't get assigned to anything and even if it did, it's not returning anything. Yes, if you follow the FAQ you can get working code.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

製品

質問済み:

2014 年 10 月 13 日

コメント済み:

2014 年 10 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by