MATLAB: Circle function issue i don;t know why it’s not working and giving me the error of undefined function or variable.

circledistance_learninggradermatlab_graderundefined function or variable

Write a function called circle that takes a scalar input r. It needs to return an output called area that is the area of a circle with radius r and a second output, cf that is the circumference of the same circle. You are allowed to use the built-in function pi. In fact, you need to use it to get the value of π as accurately as possible.
this is what i have but i can't run this and i get the error of
Undefined function or variable 'circle'.
and i can't run the grader as well.

Best Answer

Are you sure that circle.m is in the current folder that runs across the top of your editor, and shows up in the current folder panel on the left hand side? For some reason, your circle() function is not in your script, plus it's not on the search path either (which includes the current folder and toolbox folders, and possibly some other folders if you had added them to the search path).
Related Question