Learn Basic Plotting Principles

by

 

18 Oct 2009 (Updated )

Powerpoint Slides on the fundamentals of plotting and using the function line() with animation.

slide39
function slide39
	
	figure('units','normalized',...
		'position',[0.1 .3 .5 .5],...
		'color',[ 1 1 1],...
		'menubar','none',...
		'name','Example',...
		'numbertitle','off');
	
	axes('units','normalized',...
		'position',[ .5 .4 .4 .5]);
	
	L1 = line([1 3],[3 4]);
	set(L1,'linewidth',2,...
		'color',[0,0,0])
	
	axis([-4 7 0 8])
	
	while true
		
		lx = get(L1,'xdata');
		
		lnew = lx - 0.01;
		
		set(L1,'xdata',lnew)
		
		drawnow
		
	end	
	
end

Contact us