# rowop - %last updated 2/10/96 %ROWOP Perform row reduction...

This preview shows pages 1–3. Sign up to view the full content.

%last updated 2/10/96 %ROWOP Perform row reduction on real matrix A by explicitly choosing % row operations to use. A row operation can be "undone", but % this feature cannot be used in succession. Matrices can be % at most 6 by 6. % % Use in the form ===> rowop <=== % % If the matrix A is complex, the routine REDUCE is called. % % By: David R. Hill, Mathematics Dept., Temple Univ. % Philadelphia, PA. 19122 Email: hill@math.temple.edu %strings s0=' '; s1='Error: Row number out of range.'; s2='Error: Multiplier must be nonzero and real.'; s3='Executed row operation '; header=' ROWOP for MATRIX REDUCTION'; cont='Press ENTER to continue.'; %checking range of row subscripts rangeck='vnum=abs(fix(num));if vnum<=0 | vnum>m | vnum~=num,'; rangeck=[rangeck 'errnum=''ONN'';else,errnum=''OFF'';end']; %checking range of matrix size rangeckz='vnum=abs(fix(num));if vnum<=0 | vnum>rowmax | vnum~=num,'; rangeckz=[rangeckz 'errnum=''ONN'';else,errnum=''OFF'';end']; %Setting switches for recognizing have complete rowop info to NOO setnoo='havei1=''NOO'';havej1=''NOO'';'; setnoo=[setnoo 'havek2=''NOO'';havei2=''NOO'';']; setnoo=[setnoo 'havei3=''NOO'';havej3=''NOO'';havek3=''NOO'';']; eval(setnoo); %wiping out all editable text regions wipetext='set(rinti,''string'','' ''),'; wipetext=[wipetext 'set(rintj,''string'','' ''),']; wipetext=[wipetext 'set(rmultk,''string'','' ''),']; wipetext=[wipetext 'set(rmulti,''string'','' ''),']; wipetext=[wipetext 'set(rcombk,''string'','' ''),']; wipetext=[wipetext 'set(rcombi,''string'','' ''),']; wipetext=[wipetext 'set(rcombj,''string'','' '');']; %STARTING THINGS for input clc disp(s0),disp(header),disp(s0) disp('Enter matrix A by entries between square brackets [ . .. ]') disp('or use the name of an existing matrix.') disp(s0) A=input('Matrix A = '); %Any existing matrix A is destroyed. a=A;oldA=A; [m n]=size(A);

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

View Full Document
%CHECKING valid input. %IF COMPLEX STOP and run REDUCE if sum(sum(abs(imag(A))))>eps reduce(A); return end num=m;eval(rangeckz);%checking # of rows in input matrix if errnum=='ONN' disp('Matrix too large; max size is 6 by 6.') return end num=n;eval(rangeckz);%checking # of columns in input matrix if errnum=='ONN' disp('Matrix too large; max size is 6 by 6.') return end % %COLOR settings bkgr='white'; %background color bkgray1=[.8 .8 .8]; %background for editable text %callbacks for row interchange %CALLBACK for getting value of i cbirowi='havei1=''NOO'';rowi=str2num(get(rinti,''string''));num=rowi;'; cbirowi=[cbirowi 'delete(messhndl),delete(meshndl2),eval(setmess),']; cbirowi=[cbirowi 'eval(rangeck);if errnum==''ONN'',']; cbirowi=[cbirowi 'set(txtHndl,''string'',s1),pause(4),set(txtHndl,''string'',s0),']; cbirowi=[cbirowi 'set(rinti,''string'','' ''),havei1=''NOO'';else,']; cbirowi=[cbirowi 'havei1=''YES'';end,if havei1==''YES'' & havej1==''YES'',']; cbirowi=[cbirowi 'eval(dointchg),end']; %CALLBACK for getting value of j cbirowj='havej1=''NOO'';rowj=str2num(get(rintj,''string''));num=rowj;';
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/26/2012 for the course MA 261 taught by Professor Stefanov during the Spring '08 term at Purdue University-West Lafayette.

### Page1 / 8

rowop - %last updated 2/10/96 %ROWOP Perform row reduction...

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

View Full Document
Ask a homework question - tutors are online