HI respected MatLab community members,
could anyone help how to generate text file of it.
Thanks in advance for all kind cooperation and support.
Regards,
R1 = 16; R2 = 12; R3 = 8; C1=[10 12 14]; C2=[28 18 20]; C3 = [40 24 26];figure(1) numPoints = 10000; r = randn(3, numPoints);r = bsxfun(@rdivide, r, sqrt(sum(r.^2,1)));r = R1 * r;x1=C1(1,1);y1=C1(1,2);z1=C1(1,3);Xs1 = r(1,:) + x1 ; % Extract Xs1 from row #1.
Ys1 = r(2,:) + y1; % Extract Ys1 from row #2.
Zs1 = r(3,:) + z1; % Extract Zs1 from row #3.
% Display the shell of points
numPoints = 10000;r = randn(3, numPoints);r = bsxfun(@rdivide, r, sqrt(sum(r.^2,1)));r = R2 * r;x2 = C2(1,1);y2 = C2(1,2);z2 = C2(1,3);Xs2 = r(1,:) + x2; % Extract Xs2 from row #1.
Ys2 = r(2,:) + y2; % Extract Ys2 from row #2.
Zs2 = r(3,:) + z2; % Extract Zs2 from row #3.
hold onnumPoints = 10000;r = randn(3, numPoints);r = bsxfun(@rdivide, r, sqrt(sum(r.^2,1)));r = R3 * r;x3 = C3(1,1);y3 = C3(1,2);z3 = C3(1,3);Xs3 = r(1,:) + x3; % Extract x from row #1.
Ys3 = r(2,:) + y3; % Extract y from row #2.
Zs3 = r(3,:) + z3; % Extract z from row #3.
hold onaxis square; xlabel('X', 'FontSize', 20);ylabel('Y', 'FontSize', 20);zlabel('Z', 'FontSize', 20);%Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]); hold off axis square; xlabel('X', 'FontSize', 20);ylabel('Y', 'FontSize', 20);zlabel('Z', 'FontSize', 20);%Enlarge figure to full screen.set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]); hold off ix1 = (Xs1-x2).^2+(Ys1-y2).^2+(Zs1-z2).^2 < R2^2;scatter3(Xs1(~ix1),Ys1(~ix1),Zs1(~ix1),20,'r','h','filled','MarkerFaceColor',[1 0 0])hold onix2 = (Xs2-x1).^2+(Ys2-y1).^2+(Zs2-z1).^2 < R1^2;scatter3(Xs2(~ix2),Ys2(~ix2),Zs2(~ix2),20,'r','h','filled', 'MarkerFaceColor',[1 0 0])hold onix3 = (Xs3-x2).^2+(Ys3-y2).^2+(Zs3-z2).^2 < R2^2;scatter3(Xs3(~ix3),Ys3(~ix3),Zs3(~ix3),20,'r','h','filled', 'MarkerFaceColor',[1 0 0])hold on ix4= (Xs2-x3).^2+(Ys2-y3).^2+(Zs2-z3).^2 < R3^2;scatter3(Xs2(~ix4),Ys2(~ix4),Zs2(~ix4),20,'r','h','filled', 'MarkerFaceColor',[1 0 0])
Best Answer