Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
for tests=1:5
xc_truth=randn;
yc_truth=randn;
r_truth=rand;
rand_ang=randi(360,3,1)+rand(3,1); % Avoid duplicate location via rand(3,1)
pts=[xc_truth+r_truth*cosd(rand_ang) yc_truth+r_truth*sind(rand_ang)];
[xc,yc,r]=find_circle(pts);
%dif=[xc yc r]-[xc_truth yc_truth r_truth]
assert(max(abs([xc,yc,r]-[xc_truth,yc_truth,r_truth]))<1e-6,...
sprintf('Expect xc %.2f yc %.2f r %.2f Ans:%.2f %.2f %.2f',...
xc_truth,yc_truth,r_truth,xc,yc,r))
end
|
Select every other element of a vector
16237 Solvers
Which values occur exactly three times?
3307 Solvers
616 Solvers
Least common multiple of many numbers
159 Solvers
Remove the two elements next to NaN value
310 Solvers