% Sub-Program for DEPINT IMAGCOMPLT IMAGe COMputation and PLoT Su/24/1/99 if frmula == 1 ym1sp=y(1)-w/2 % Find starting points y1 - Continuous case ym1spr=yr(1)-wr/2 % Find starting points y2 - Discrete case ym2sp=y(2)-g/2 % " y1 - C ym2spr=ym1spr+wgr/2 % " y2 - D if ym1sp < 0 menu('Better to choose other option i.e. gap -> elctrd','press to continue'); fpoint1 = 2; end else %if frmula == 2 ym1sp=y(1)-g/2 ym1spr=yr(1)-gr/2 ym2sp=y(2)-w/2 ym2spr=ym1spr+wgr/2 if ym1sp < 0 menu('Better to choose other option i.e. elctrd -> gap','press to continue'); fpoint1 = 2 end end % end frmula selection wgm=wg*mp1 % Continuous w & g ye1v=y(1):wg:pmxtrv % Y Edge 1 Vector (irrespective of frmula) ye2v=y(2):wg:pmxtrv % Y Edge 2 Vector (irrespective of frmula) ym1v=ym1sp:wg:pmxtrv % Y Mid-way 1 Vector (irrespective of frmula) ym2v=ym2sp:wg:pmxtrv % Y Mid-way 2 Vector (irrespective of frmula) wgmr=wgr*mp1 ye1vr=yr(1):wgr:pmxtrv % Y Edge 1 Vector (irrespective of frmula) ye2vr=yr(2):wgr:pmxtrv % Y Edge 2 Vector " fgrop=2*(gr/2-floor(gr/2)) % Flag for gr ODD parity (= 1 Odd, 0 even) fwrop=2*(wr/2-floor(wr/2)) % Flag for wr ODD parity (= 1 Odd, 0 even) ym1vr=ym1spr:wgr:pmxtrv % Y Mid-way 1 Vector (irrespective of frmula) ym2vr=ym2spr:wgr:pmxtrv % Y Mid-way 2 Vector " k=1:20:pmxlng; hold on plot(10,ye1v,'c+',30,ye1vr,'g+',690,ye1v,'c+',710,ye1vr,'g+') plot(10,ye2v,'m+',30,ye2vr,'r+',690,ye2v,'m+',710,ye2vr,'r+') dummy=menu('satisfied with points computer selected?','Yes','No'); fpoint1 = dummy vwgset = 1