MATLAB: How to remove the lines that are not in the cross section of the annulus

graphgraphinglineplotplotting

Best Answer

figure(1);
% add lj line to temperature profile
hold on;
for ii=0:1
[P1,P2]=deal([x(1+ii);y(1+ii)], [x(2+ii);y(2+ii)]);
fun=@(t) norm(t*P1+(1-t)*P2);
[~,R]=fminbnd(fun,0,1);
if R<R1; continue; end
line([P1(1),P2(1)],[P1(2),P2(2)],'color','red');
end