69 8 12 16 10 15 20 25 Write a function that has 2 parameters: a vector with x,
ID: 653783 • Letter: 6
Question
69 8 12 16 10 15 20 25 Write a function that has 2 parameters: a vector with x, y values which is a circle center point, and the radius (cms) of the circle. The function reads the file points.xlsx' of x,y points one per line and stores it in a matrix. The function determines which of the points in the file lies within the circle defined by the center point and the radius and returns a vector with the points that are not in the circle. Test your function by running it with increasing values of radius. A company generates an input file for eachExplanation / Answer
function ret = points(x,r,i)
zeros(size(x));
for j = 1:size(x)
if (j+1 == i)
continue;
else
if (sqrt(x[j][0] - x[i][0], x[j][1] - x[i][1]) < r)
zeros[j] = x[j];
end
end
end
end
x = load("points.xlsx");
prompt = 'Enter the value of Radius ';
r = input(prompt);
for i = 1:size(x):
vector = points(x,r,i)
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.