pendi - oh = line(xo,yo...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
function Handles=pendi() f % % Initialize pendulum animation block % % EE3530 % Course Project % % Daniel Campos-Delgado % Oct. 7th, 2000 % global Handles; g fh = figure; f thisblock=gcb; t set(fh,'Name','Pendulum System',. .. 'NumberTitle','Off',. .. 'Backingstore','Off',. .. 'Units','Pixels',. .. 'Position',[300 300 400 300]); mh = uimenu('Label','Plot'); uimenu(mh,'Label','Close',. .. 'Callback',['if get_param(''',thisblock,''',''parameters''), set_param(''',thisblock,''',''parameters'',''0'');end; clear Handles; close']); s ah = axes; axis([-17 17 -13 5]); axis('off'); set(ah,'DrawMode','fast','Clipping','off'); set(ah,'Units','normalized','Position',[0.05 0.05 0.9 0.9]); s % Draw the floor; xf = [-17 17 17 -17]; yf = [0 0 5 5]; flh = patch(xf,yf,'k'); set(flh,'Visible','on'); s % Draw origin axis xo = [0 0]; yo = [-13 0];
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: oh = line(xo,yo); set(oh,'Visible','on','LineStyle','-.','LineWidth',0.5); s %draw k=1/sqrt(2); xop=0.8*[-1 -k 0 k 1]; yop=0.8*[0 -k -1 -k 0]; poh=patch(xop,yop,'k'); set(poh,'Visible','on'); s % draw pendulum body using x & theta states theta=0*pi/180; xp=[0 10*sin(theta)]; yp=[0 -10*cos(theta)]; plh=line(xp,yp); set(plh,'Visible','Off','LineWidth',1,'Color',[1 1 1]); s % draw pendulum point mass using x & theta states xpm=10*sin(theta); ypm=-10*cos(theta); pmh=line(xpm,ypm,'Marker','o','MarkerSize',12,'MarkerFaceColor',[1 0 0.1],. .. 'MarkerEdgeColor',[1 0 0.1]); set(pmh,'Visible','Off'); s Handles=[plh pmh poh oh]; set(fh,'UserData',Handles); set(Handles,'EraseMode','background'); %set_param(thisblock,'parameters','1'); %...
View Full Document

This note was uploaded on 12/01/2009 for the course Q q taught by Professor Q during the Spring '09 term at Universidad Autonoma de Nuevo Leon - School of Business.

Page1 / 2

pendi - oh = line(xo,yo...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online