I have now replaced symbolic solver with fsolve to speed up the code; however, it only gives out one of the solution and not the other one...the is much more quick now, but does not printout one of the solutions. what should i do?
m1=(P(2,2)-P(1,2))/(P(2,1)-P(1,1)); % line 1
m2=(P(3,2)-P(2,2))/(P(3,1)-P(2,1)); % line 2
m3=(P(4,2)-P(3,2))/(P(4,1)-P(3,1)); % line 3
int=0; % counting the points of intersection - it has to be 2 at the end, in case there is intersection
Points(2,2)=0;
% intersection of circle with line 3
F = @(x)[(x(1)-xc)^2+((P(3,2)+m3*(x(1)-P(3,1)))-yc)^2-R^2;(x(2)-xc)^2+((P(3,2)+m3*(x(2)-P(3,1)))-yc)^2-R^2];
opts = optimoptions('fsolve', 'Display', 'off');
x = fsolve(@(x) F(x), zeros(1,2), opts);
y3=P(3,2)+m3*(x-P(3,1));