me351_DesignEx

2 xminminrealpts d xmaxmaxrealptsd yminminimagpts d

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ks(5,np); end % now size the plots d=0.2; xmin=min(real(Pts))-d; xmax=max(real(Pts))+d; ymin=min(imag(Pts))-d; ymax=max(imag(Pts))+d; xmin=min(xmin); ymin=min(ymin); xmax=max(xmax); ymax=max(ymax); for np=1:3 subplot(1,3,np); % comment out for separate figures %figure(np); % uncomment for three separate figures axis([xmin,xmax,ymin,ymax]); axis square; draw_mech(zlnks(1:5,np)); end function draw_mech(zlnks) % draw_mech(zlnks) % INPUT: % zlnks=[z1,z2,z3,z4,z5]=complex vectors specifying a 4 bar mechanism % and precision point z2+z5 % Loop equation assumed to be z2+z3-z4-z1=0 % OUTPUT: % Draws picture of 4 bar linkage hold on pts=linspace(0,1,100); plot(zlnks(2),’ro’);plot(pts*zlnks(2));plot(zlnks(2)+pts*zlnks(3),’r’); plot(zlnks(2)+zlnks(3),’ro’); plot(zlnks(2)+zlnks(3)-pts*zlnks(4));plot(zlnks(1),’co’); plot(zlnks(1)-pts*zlnks(1),’c’); plot(0,0,’co’); plot(zlnks(2)+pts*zlnks(5),’r’); plot(zlnks(2)+zlnks(3)+pts*(zlnks(5)-zlnks(3)),’r’); plot(zlnks(2)+zlnks(5),’ro’); % precision...
View Full Document

Ask a homework question - tutors are online