example_fill - left(i) = y0up + slpe*h; %generating lines...

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

View Full Document Right Arrow Icon
clear all close all clc c % this is a simple demonstration of the "fill" command % Filling the space between 2 lines 'left' and 'right' % and an upper limit hm slpe = 1; %slope of lines y0up = 0; %independent variable y0dn = 25; y h0 = 0.0; %starting height dh = 0.1; %increment hf = 10.0; %final height hm = 9.0; %upper limit hvec = h0:dh:hf; hmvc = h0:dh:hm; h h = h0; i = 1; left = zeros(length(hvec),1); rght = zeros(length(hvec),1); lfill = zeros(length(hmvc),1); rfill = zeros(length(hmvc),1); while(h <= hf)
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: left(i) = y0up + slpe*h; %generating lines rght(i) = y0dn - slpe*h; if(h <= hm) %left and right boundaries lfill(i) = left(i); rfill(i) = rght(i); end h = h + dh; i = i + 1; end e xfill = [lfill;flipud(rfill)]; %x-coordinates of region to be filled, including %left boundary and right boundary yfill = [hmvc,fliplr(hmvc)]; %y-co-ordinates of region to be filled % figure plot(left,hvec,'k',rght,hvec,'k') hold on pause fill(xfill,yfill,'b') f f...
View Full Document

This note was uploaded on 09/18/2011 for the course ASE 167M taught by Professor Staff during the Spring '10 term at University of Texas.

Page1 / 2

example_fill - left(i) = y0up + slpe*h; %generating lines...

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