Help creating an ellipse

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 Comment

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])

Sign in to comment.

 Accepted Answer

Image Analyst
Image Analyst on 13 Oct 2014

0 votes

3 Comments

I haven't seen the FAQ. Will my code run properly if I follow the instructions on the page?
I'm looking to fix my function so that, when I call it, it will work properly.
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!