Problem 554. Is the Point in a Circle?
Solution Stats
Problem Comments

7 Comments
error in the test:
assert(isequal(your_fcn_name(x),y_correct))
Error: Undefined function or variable 'x'.
Should be:
assert(isequal(your_fcn_name(Points,circle),y_correct))
I went ahead and fixed the calling syntax on that.
Thanks for the corrections!
You should correct the first test!
The first test case is wrong.
The first test case is wrong, is FALSE
Is the Point on a Disk?
Is the Point inside a Circle?
Solution Comments

1 Comment
The first Test is Wrong !!
point = [0, 0.5] is not on the unity circle !!

1 Comment
In the last test, the first point is not in, but on the circle!!!

1 Comment
A valid, compact submission. [But note that the function used here was first
introduced in R2017b, and not available to Cody Players before circa Sept 2017.]

2 Comments
I thought "in" a circle meant interior...the 3rd test is ON the circle.
I agree that the Problem Statement was, at best, ambiguous on this detail — or, at worst, misleading. As a separate matter, the example should consistently use brackets, not a mixture of brackets and parentheses.

1 Comment
Exploits somewhat limited number of tests within Test Suite. Please add additional tests. You may also consider including some random elements in the input vectors. E.g. Points = [0, rand/2] instead of (or as well as) the existing Points = [0, 0.5] in the first test. It won't necessarily 'prevent' all exploits, but it will make them much less attractive.

2 Comments
Shouldn't this work?
Not (these days) on Cody. See https://www.mathworks.com/matlabcentral/cody/solutions/351962#comment_9934

1 Comment
Pure hack: should be rescored with enhanced Test Suite.

1 Comment
Exploits Cody. Use assessFunctionAbsence to thwart (see also Problem 44521).

1 Comment
Another exploitation based on the somewhat limited number of tests.

1 Comment
Exploits Cody. Use assessFunctionAbsence to thwart (see also Problem 44521).

1 Comment
Yet another hardcoded exploit.

1 Comment
A valid solution at time of submission. [But will not be accepted in new Cody submissions, per comment on Solution 894324.]
Problem Recent Solvers406
Suggested Problems

Determine whether a vector is monotonically increasing
15843 Solvers

3798 Solvers

Find state names that start with the letter N
959 Solvers

Create a Multiplication table matrix...
355 Solvers

436 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!