“…; end xLS(k+1,:)=xa; yLS(k+1,:)=ya; zLS(k+1,:)=za; end figure(1), subplot(221), plot3(xa,ya,za,'ko','markersize',6,'linewidth',2); %plot(xb,yb,'ro','markersize',6,'linewidth',2); for i=1:nxy, plot3(xLS(:,i),yLS(:,i),zLS(:,i),'k:','linewidth',1); end %for i=1:nxy, plot(xTLS(:,i),yTLS(:,i),'r','linewidth',1); end xlabel('x','fontsize',14,'fontweight','bold'), ylabel('y','fontsize',14,'fontweight','bold'), title('Robot movement is x to o','fontsize',14,'fontweight','bold'); zlabel('z','fontsize',14,'fontweight','bold'), h=gca; set(h,'fontsize',14); grid on hold off subplot(222), plot3(xa,ya,za,'ko','markersize',6,'linewidth',2); for i=1:nxy, plot3(xLS(:,i),yLS(:,i),zLS(:,i),'k:','linewidth',1); end xlabel('x','fontsize',14,'fontweight','bold'), ylabel('y','fontsize',14,'fontweight','bold'), title('Robot movement is x to o','fontsize',14,'fontweight','bold'); zlabel('z','fontsize',14,'fontweight','bold'), h=gca; set(h,'fontsize',14); grid on hold off view (2) subplot(223), plot3(xa,ya,za,'ko','markersize',6,'linewidth',2); for i=1:nxy, plot3(xLS(:,i),yLS(:,i),zLS(:,i),'k:','linewidth',1); end xlabel('x','fontsize',14,'fontweight','bold'), ylabel('y','fontsize',14,'fontweight','bold'), title('Robot movement is x to o','fontsize',14,'fontweight','bold'); zlabel('z','fontsize',14,'fontweight','bold'), h=gca; set(h,'fontsize',14); grid on hold off view(90,0) subplot(224), plot3(xa,ya,za,'ko','markersize',6,'linewidth',2); for i=1:nxy, plot3(xLS(:,i),yLS(:,i),zLS(:,i),'k:','linewidth',1); end xlabel('x','fontsize',14,'fontweight','bold'), ylabel('y','fontsize',14,'fontweight','bold'), title('Robot movement is x to o','fontsize',14,'fontweight','bold'); zlabel('z','fontsize',14,'fontweight','bold'), h=gca; set(h,'fontsize',14); grid on hold off view(0,0) % XTRAS %xcm=zeros(nstep+1,1); ycm=zeros(nstep+1,1); %xcm(1,1)=sum(xa)/nxy; ycm(1,1)=sum(ya)/nxy; %plot(xa,ya,'bx',xcm (1,1),ycm (1,1),'mx'); hold on, %plot(xcm(:,1),ycm(:,1),'m') %plot(xcm(nstep+1,1),ycm(nstep+1,1),'mo') A.8 Local3DSN.m function [xLS,yLS,zLS]=dscc3D(fcn,nstep) % function [xLS,yLS,xTLS,yTLS]=dscc(fcn,cflag,nstep,xa,ya,za) % % fcn: character string of function (must also have input fcn name) % nstep: number of steps (updates) to perform % xa, ya: if cflag='onn', then starting positions for continuation % if cflag='off', then this will be reset % % (xa,ya,za,'kx','markersize',10,'linewidth',2); hold on, subplot(222), plot3 (xa,ya,za,'kx','markersize',10,'linewidth',2); hold on, subplot(223), plot3 (xa,ya,za,'kx','markersize',10,'linewidth',2); hold on, subplot(224), plot3 (xa,ya,za,'kx','markersize',10,'linewidth',2); hold on, for k=1:nstep % for update at once % eval(['bLS=' fcn '(xa,ya,za);']); % bLS = bLS*(1 + percentSN/100 * 2*(rand(1,nxy)-0.5)); for i=1:nxy % for update when ready eval (['bLS=' fcn '(xa,ya,za);']); bLS = bLS*(1 + percentSN/100 * 2*(rand(1,nxy)-0.5)); xa = xa + percentPN * 2*(rand(1,nxy)-0.5); ya = ya + percentPN * 2*(rand(1,nxy)-0.5);…”