Check whether a point or multiple points is/are in a circle centered at point (x0, y0) with radius r.
Points = [x, y];
circle = (x0, y0, r)
Return true or false for each point tested
error in the test:
Error: Undefined function or variable 'x'.
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
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.]
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.
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.
Exploits Cody. Use assessFunctionAbsence to thwart (see also Problem 44521).
Shouldn't this work?
Not (these days) on Cody. See https://www.mathworks.com/matlabcentral/cody/solutions/351962#comment_9934
Pure hack: should be rescored with enhanced Test Suite.
Another exploitation based on the somewhat limited number of tests.
Yet another hard-coded exploit.
A valid solution at time of submission. [But will not be accepted in new Cody submissions, per comment on Solution 894324.]
Read a column of numbers and interpolate missing data
Create an index-powered vector
Matrix to column conversion
Divide by 4
Is the Point in a Triangle?
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office