P-file 1.0 Z47Bchem_installansxNLDOS_NAMENEW_FILEBAD_FILEADD_BINAADD_TEXTEND_FILEPROGRESSmfiledosfilemfuncmtext>0?\ns:3'?:PCWINfi<findstr @*@$:3'?:VAX_VMS<findstr @*@$:3'?4if findstr(computer, 'PCWIN'), mfile = dosfile; end;3'?[fp, msg] = fopen(mfile, 'w');B3'?if(fp < 0), error(msg), end;3'?fwrite(fp, mtext, 'uchar');3' ? fprintf(fp, mtext);3' ?  fclose(fp);3' ? disp([' Unbundled: ' mfile])3' ?  ##:3-? % ## Generated by BUNDLE: chem_install #:3-? ## Created: 1999.10.26.13.48.48:3-?7 ## Copyright (C) 1994-9 Dr. Charles R. Denham, ZYDECO.:3-? ## All Rights Reserved.:3-? ## E-Mail: cdenham@usgs.gov. #:3-?- ## WWW: http://crusty.er.usgs.gov/~cdenham/.na:3-? ##:3-?:c: ? makedir.mdo3'  makedir.mdo3'makedir3'?%;3-?%;3-?%;3-?function makedir(varargin)%%#%% makedir -- Make a new directory.%B%% makedir('thePath') creates a new sub-directory named 'thePath'%%?%% (no embellishments), located within the current directory.%>%% A dialog is invoked if manual intervention is needed. No%%=%% action is taken if the desired directory already exists.%%%=%% The "present-working-directory" itself remains the same.%%%<%% makedir "p q r" assumes that the arguments represent one%5%% path-name with single-blanks between components.%%%1%% makedir p q r is the same as makedir "p q r".%%%%6%% Copyright (C) 1996-7 Dr. Charles R. Denham, ZYDECO.%%%% All Rights Reserved.%9%% Disclosure without written explicit consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 08-Jul-1997 08:36:09.%#%% Revised 04-Nov-1998 21:57:53.%#%% Revised 05-Nov-1998 15:24:50.%%+if nargin < 1, help(mfilename), return, end%% thePath = '';fo%for i = 1:length(varargin) %) if i > 1, thePath = [thePath ' ']; end %# thePath = [thePath varargin{i}];%end%%6if thePath(1) == '"' & thePath(length(thePath)) == '"' %* thePath = thePath(2:length(thePath)-1);i%end%3'?<% ;3-?=% itExists = 1;tr%trystr = 'cd(thePath); cd ..';c%catchstr = 'itExists = 0;';%eval(trystr, catchstr)i% if itExists%8 disp([' ## Directory already exists: "' thePath '"'])% returnla%end%% lasterr('')%*warn = 'warning(lasterr); lasterr('''');';t%% thePWD = pwd;if%$if thePWD(length(thePWD)) == filesep% thePWD(length(thePWD)) = '';%end%%5if exist('mkdir', 'builtin') | exist('mkdir', 'file') %+ theCommand = ['mkdir(''' thePath ''')'];%& elseif any(findstr(computer, 'MAC')) %/ theCommand = ['newfolder(''' thePath ''')'];%& elseif any(findstr(computer, 'VMS')) %C theCommand = ['!create/directory "' thePWD filesep thePath '"'];% else %8 theCommand = ['!mkdir "' thePWD filesep thePath '"'];%end%%disp([' ## ' theCommand])ev%eval(theCommand, warn)t%%,trystr = 'itExists = 1; cd(thePath); cd ..';%3'?_% ;3-?`catchstr = 'itExists = 0;';%eval(trystr, catchstr)i%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% returnla%end%%,thePrompt = ['Make New ' thePath ' Folder'];%%theInstruction = 'Create, Then Save';wh%while ~itExists%. if any(uisetdir(thePrompt, theInstruction)) % cd ..% eval(trystr, catchstr)% else % break% end % thePrompt = [thePrompt '!'];%end%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% else %0 disp([' ## Unable to create: "' thePath '"'])%end%%-function theResult = newfolder(theFolderName)%%%%.%% newfolder -- Create a new Macintosh folder.%%6%% newfolder('theFolderName') creates a new Macintosh%%8%% folder of 'theFolderName' in the current directory.%5%% The current directory setting remains unchanged.%%%3'?% ;3-?6%% If the folder already exists, no action is taken.%%6%% The result is logical(1) if successful; otherwise%%%% it is logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 05-Sep-1997 17:01:27.%%4%% The applescript commands in file "newfolder.mac".%%%%%0%% set theTarget to thePath & ":" & theNewFolder%&%% if not (exists item theTarget) then%%'%% make new folder at folder thePath%L%% set name of folder "untitled folder" of folder thePath to theNewFolder% %% end ifif%% if nargin < 1 % help(mfilename)i% returnla%end%%!if ~any(findstr(computer, 'MAC')) %N disp([' ## No action taken: "' mfilename '" requires Macintosh computer.'])t% returnla%end%%thePath = pwd;w%)while thePath(length(thePath)) == filesep %! thePath(length(thePath)) = '';th%3'?% ;3-?end%thePath = ['"' thePath '"'];%%'theNewFolder = ['"' theFolderName '"'];%%2result = feval('applescript', 'newfolder.mac', ... %> 'thePath', thePath, 'theNewFolder', theNewFolder);i%%&if ~isempty(result), disp(result), endr%%"result = logical(isempty(result));i%%'if nargout > 0, theResult = result; end%%8function theStatus = uisetdir(thePrompt, theInstruction)%%6%% uisetdir -- Open the destination folder via dialog.%%D%% uisetdir('thePrompt', 'theInstruction') presents the "uiputfile"%D%% dialog with 'thePrompt' and 'theInstruction', for selecting the%C%% desired destination folder. The returned status is logical(1)%*%% if successful; otherwise, logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 03-Jul-1997 09:16:00.%%=if nargin < 1, thePrompt = 'Open The Destination Folder'; endif%3if nargin < 2, theInstruction = 'Save If Okay'; end%%3'?% ;3-?theFile = 0; thePath = 0;[t%:[theFile, thePath] = uiputfile(theInstruction, thePrompt);s%%status = 0; % if isstr(thePath) & any(thePath)% status = 1; %% eval('cd(thePath)', 'status = 0;')if%end%%1if nargout > 0, theStatus = any(any(status)); endne%3'?% ;3-?% ;3-?% ;3-? newfolder.mac453'  newfolder.mac453' newfolder.mac453'?%;3-?%;3-?%;3-?@F@F@*@F@F@@@P@\@Y@@X@@]@Y@@@@X@@@@[@Y@@]@@@Y@[@[@Y@Y@@\@G@*@F@F@*@F@F@@@P@[@\@^@@\@Z@@Y@Z@]@@@D@P@D@@@H@L@L@K@@@Q@\@G@@@P@Z@X@@\@[@Y@@\@@@T@G@@@Q@Y@@[@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z@@]@Y@@[@@@@]@Z@Y@@U@X@@\@Y@Y@@]@D@@@]@Z@Y@@[@*@"@"@[@@X@@Z@Y@@@@[@Y@@]@@@Y@[@[@Y@Y@@\@@@X@@]@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@*@"@"@\@Y@@]@@@[@X@@[@@Y@@@@[@Y@@@Y@[@[@Y@Y@@\@@@A@]@@[@]@Z@@]@[@Y@@Y@@@Y@[@[@Y@Y@@\@A@@@[@Y@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@@@]@[@@@]@Z@Y@@S@Y@@]@Q@[@[@Y@Y@@\@*@"@Y@@[@Y@@@Z@@Y@*@"@F@F@*@Y@@[@Y@@@]@Y@@[@[@*3'?% ;3-?% ;3-?% ;3-? makedir chem;3-?cd chem;3-?README.m3' readme.m3'READMER3'?%;3-?%;3-?%;3-?README -- Chemistry Toy Box% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 11:45:38.%#%% Updated 25-Oct-1999 20:42:52.%% Questions1.%%61. What can one do with simple chemical algebra, using %4 the Matlab set of allowed names and operators?%&2. Does a standard tty notation exist?3%53. Should diatomic H be denoted as 2*H, H*2, or both?4.%/4. Should valence be expressed by Ca(+2), Ca+2,%6 Ca-2*electron, or all three? Should parentheses %% be reserved for something else?5.%35. What information is needed in a useful database,%5 besides the Periodic Table and common valences?Ho%%How "Chem" Works%%MThe Chemistry Toy Box uses some of the objected-oriented features of Matlab-5to%Oto define classes for basic atoms, compounds, protons, electrons, and neutrons.%OAdding particles together creates atoms, and combining atoms creates compounds.%NAtoms can be changed by varying the number of particles, such as when buildingi%Mions by adding or subtracting electrons. Likewise, compounds are created andmo%Lmodified changed by combining them with other compounds and atoms in various%Jproportions. The toybox has several operators, including "+" for assemblya%and "*" for scaling.%3'?&% ;3-?'%Periodic TableT%%;The "atoms.m" script defines all the elements in their most%;common isotopic form, using the standard atomic symbol that%@begins with an uppercase letter, as in "Fe" for iron. Neptunium%9is given as "NP", to reserve "Np" for the N+ nitrous ion.Th%,The several unnamed elements are uppercased.%%AtomsAt%%7Atoms are built in two ways, either by using the "atom"%8argument-list, or by adding components to an empty atom.%:(The "atoms" function builds the Periodic Table by callingt%the "atom" constructor.)%%)To build simple hydrogen and oxygen, use: H%% H = atom('H', 1, 1, 0)% O = atom('O', 8, 10, 8)%%or %%" H = atom('H') + proton + electron %3 O = atom('O') + 8*proton + 10*electron + 8*neutron%% CompoundsAs%%AAs with atoms, compounds are built by adding components together.To%%;To build water, the ions of hydrogen and oxygen are needed:%%3'?I% ;3-?J& Hp = H - electron; %% H+1 or H(+1) %% Omm = O + 2*electron %% O-2 or O(-2) w%%' water = 2*Hp + Omm %% 2*(H+1) + (O-2)%% Similarly: %%& hydroxyl = Hp + Omm %% (H+1) + (O-2)C%% Constructors:pr%%protone%electron%neutron%(particle = {proton | electron | neutron}%atom = particle + particlea%atom = atom {+ | -} particle%#ion = {atom | ion} {+ | -} electron%6compound = {atom | compound} {+ | -} {atom | compound}S%% Scaling: * %% proton = 2*proton;% electron = 2*electron;% neutron = 2*neutron; a% atom = 2*atom;% compound = 2*compoundT%%MThe scaling operator (*) is needed for combining several identical componentssu%such as:%% water = 2*Hp + Omm%3'?l% ;3-?m In%LInternally, the result may be stored with two independent hydrogens, or they%Jmay be represented by a single hydrogen whose amount = 2. With more work,t%Hthe two representations might be interchangeable, using a "simplify" and%an "expand" operator.As%%Assembling: + or - %%# atom = proton + electron + neutron%- atom = atom +/- {proton | electron |neutron} c%% compound = atom + atom%) compound = compound +/- {atom, compound}Ad%%Adding ValenceV%%*Valences are given to atoms in three ways: %% 1. Fepp = Fe+2 (the Fe++ ion) % 2. Fepp = Fe(+2) 3% 3. Fepp = Fe - 2*electronN% In%7Note that a "p" suffix for positive valence; similarly,%use "m" for negative valence.Re% In%Representing Atomic WeightU%%?Use names like "Fe56" to describe the particular isotope. With% 0 % w = which(theFunction); % f = findstr(w, filesep);% if any(f)% w = w(1:f(length(f)));%- eval(['cd(''' w(1:f(length(f))) ''')'])di% end %end%disp([' ## ' pwd])c%3'?% ;3-?% ;3-?% ;3-? chem_bundle.mch3'  chem_bundle.mch3' chem_bundle3'?%;3-?%;3-?%;3-?function chem_bundle%%3%% seagrid_bundle -- Bundler for Chemistry Toy Box.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 15-Apr-1999 16:24:49.%#%% Updated 25-Oct-1999 20:18:08.%%setdef(mfilename)ne%%newversion atom%%dst = 'chem_install';ta% target = '';%%delete([dst '.m'])d%delete([dst '.p'])b%% bundle(dst)%%/%% Get full bundle name and trim the extension.%%dst = which(dst);f %f = find(dst == '.');if%$if any(f), dst(f(end):end) = ''; end%%%% Bundle the routines.%%3'?% ;3-?bundle(dst, 'makedir', target)b%.bundle(dst, 'newfolder.mac', target, 'binary')b%+bundle(dst, 'eval', target, 'makedir chem')%&bundle(dst, 'eval', target, 'cd chem')b%%bundle(dst, 'README', target)bu%%bundle(dst, 'setdef', target)bu%%"bundle(dst, 'chem_bundle', target)b%%bundle(dst, 'chem', target)%#%% bundle(dst, 'chem.html', target)% bundle(dst, 'chem_test', target)%%bundle(dst, 'atoms', target)% bundle(dst, 'compounds', target)%bundle(dst, 'elements', target)%%bundle(dst, '@atom', target)% bundle(dst, '@compound', target)% bundle(dst, '@electron', target)%bundle(dst, '@neutron', target)%bundle(dst, '@proton', target)b%%$bundle(dst, 'eval', target, 'cd ..')%% bundle(dst, 'disp', target, ' ')%Wbundle(dst, 'disp', target, ' ## To get started, put the "chem" folder in your Matlab')%Xbundle(dst, 'disp', target, ' ## path, then execute "compounds" at the Matlab prompt.')%% %% P-coding.%3'?% ;3-?%disp(' ## P-coding...')%% pcode(dst)c%3'?!% ;3-?"% ;3-?#% ;3-?%chem.mc3' chem.mc3'chem3'?&%;3-?'%;3-?(%;3-?) function chem%%%%#%% chem -- Go to the "chem" folder.%1%% chem (no argument) goes to the "chem" folder.%%% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:09:21.%#%% Updated 23-Oct-1999 02:09:21.%%setdef(mfilename)ne%3'?:% ;3-?;% ;3-?<% ;3-?> chem_test.m3'  chem_test.m3' chem_testfu3'??%;3-?@%;3-?A%;3-?Bfunction chem_test%%%,%% chem_test -- Quick test of "chem" system.%;%% chem_test (no argument) executes a few "chem" commands.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 25-Oct-1999 20:27:25.%#%% Updated 25-Oct-1999 20:27:25.%%H = atom('H', 1, 1, 0)H%!H = atom('H') + proton + electronHp% Hp = H(+1)H%Hp = H+1%D = H + neutron%Dp = (H + neutron) + 1T%T = H + 2*neutronat%3'?Y% ;3-?Z% ;3-?[% ;3-?]atoms.m3' atoms.m3'atomsfu3'?^%;3-?_%;3-?`%;3-?a#function theResult = atoms(ionFlag)%%"%% atoms -- Periodic Table script.%%3%% atoms (no argument) defines the Periodic Table.%9%% atoms(doIons) also defines the common ions if ionFlag%%%5%% is TRUE. If an output argument is provided, the%%%7%% atoms are returned as a "struct", whose fieldnames%7%% are the atomic symbols themselves. Otherwise, the%0%% atoms are placed in the caller's workspace.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 12:56:50.%#%% Updated 25-Oct-1999 20:14:32.%%if nargin < 1, ionFlag = 0; end%#if nargout > 0, theStruct = []; end%%theElements = elements;%%, n] = size(theElements);%% for i = 1:m% symbol = theElements{i, 1};% protons = theElements{i, 2}; e% electrons = protons; w% weight = theElements{i, 3};%$ neutrons = round(weight) - protons;% valences = theElements{i, 4}; %3'?% ;3-?2 args = {symbol, protons, electrons, neutrons, 1}; % theAtom = atom(args{:}); i% if nargout > 0%3 theStruct = setfield(theStruct, symbol, theAtom);% else %% assignin('caller', symbol, theAtom) e% end% if any(ionFlag)% for j = 1:length(valences)% symb = symbol; % if valences(j) < 0 % code = 'm';% else% code = 'p';% end % for k = 1:valences(j)% symb = [symb code];%# theIon = theAtom + valences(j);% if nargout > 0 %3 theStruct = setfield(theStruct, symb, theIon);% else%% assignin('caller', symb, theIon) % end% end % endif% end%end%%*if nargout > 0, theResult = theStruct; endr%%return%%%3'?% ;3-?%% *** IGNORE BELOW HERE ***%%+%% The definitions are arranged roughly as:%% %% isotopes%%% common isotope%%%%% ions%%% compounds, as appropriate%%%% Row 1: H to He.H%%'H1 = atom('H', 1, 1, 1-1); %% Hydrogen.%"H2 = H1 + neutron; %% Deuterium.H%!H3 = H2 + 2*neutron; %% Tritium.H %H = H1D%D = H2T%T = H3H% Hp = H(1);D% Dp = D(1);T% Tp = T(1);H%%'He4 = atom('He', 2, 2, 4-2); %% Helium.%He = He4%%%% Row 2: Li to Ne.%%)Li7 = atom('Li', 3, 3, 7-3); %% Lithium.Li%Li = Li7% Lip = Li(1);%%*Be9 = atom('Be', 4, 4, 9-4); %% Berylium.B%Be = Be9%3'?% ;3-? Bepp = Be(2);B1%%&B11 = atom('B', 5, 5, 11-5) %% Boron.B%B = B11% Bppp = B(3);%%(C12 = atom('C', 6, 6, 12-6); %% Carbon.%C13 = C12 + neutron;%C14 = C12 + 2*neutron;C%C = C12% Cpp = C(2);% Cpppp = C(4);Cm%Cmmmm = C(-4);N%%*N14 = atom('N', 7, 7, 14-7); %% Nitrogen.N%N = N14% Np = N(1);N% Npp = N(2);% Nppp = N(3);% Npppp = N(4);Np%Nppppp = N(5);N%Nmmmm = N(-4);O%%(O16 = atom('O', 8, 8, 16-8); %% Oxygen.%O18 = O16 + 2*neutron;O%O = O16% Omm = O(-2);%%+F19 = atom('F', 9, 9, 19-10); %% Fluorine.%F = F19;% Fm = F(-1);%%3'?% ;3-?*Ne20 = atom('Ne', 10, 10, 20-10); %% Neon.N% Ne = Ne20%%%%%% Row 3: Na to Ar.%%,Na23 = atom('Na', 11, 11, 23-11); %% Sodium.% Na = Na23Na% Nap = Na(1);%%/Mg24 = atom('Mg', 12, 12, 24-12); %% Magnesium.% Mg = Mg24Mg% Mgpp = Mg(2);Al%%.Al27 = atom('Al', 13, 13, 27-13); %% Aluminum.A% Al = Al27;A%Alppp = Al(3);S%%-Si28 = atom('Si', 14, 14, 28-14); %% Silicon.Si% Si = Si28Si% Sipp = Si(2);Si%Sipppp = Si(4);%Simmmm = Si(-4);%%.P31 = atom('P', 15, 15, 31-15); %% Phosphorus.P%P = P31% Pppp = P(3);%Pppppp = P(5);P% Pmmm = P(-3);S3%%+S32 = atom('S', 16, 16, 32-16); %% Sulphur.%S = S32% Spppp = S(4);Sp%3'?% ;3-?Spppppp = S(6);% Smm = S(-2);%%.Cl35 = atom('Cl', 17, 17, 35-17); %% Chlorine.C% Cl = Cl35Cl% Clm = Cl(-1);Ar%%+Ar40 = atom('Ar', 18, 18, 40-18); %% Argon.%Ar39 = Ar40 - neutron;A%Ar38 = Ar40 - 2*neutron;% Ar = Ar40;%%%%% Row 4: K to Kr.K%%-K39 = atom('K', 19, 19, 39-19); %% Potassium.K4%K40 = K39 + neutron;%K = K39%Kp = K - electron;C%%-Ca40 = atom('Ca', 20, 20, 40-20); %% Calcium.Ca% Ca = Ca40Ca%Capp = Ca - 2*electron;%%.Sc45 = atom('Sc', 21, 21, 45-21); %% Scandium.S% Sc = Sc45Sc%Scppp = Sc - 3*electron;%%.Ti48 = atom('Ti', 22, 22, 48-22); %% Titanium.T% Ti = Ti48Ti%Tipp = Ti - 2*electron;%Tippp = Ti - 3*electron;%Tipppp = Ti - 4*electron;V5%3'?2% ;3-?3%,V51 = atom('V', 23, 23, 51-23); %% Vanadium.%V = V51%Vpp = V - 2*electron;Vp%Vppp = V - 3*electron;V%Vpppp = V - 4*electron;%Vppppp = V - 5*electron;%%.Cr52 = atom('Cr', 24, 24, 52-24); %% Chromium.C% Cr = Cr52Cr%Crpp = Cr - 2*electron;%Crppp = Cr - 3*electron;%Crpppppp = Cr - 6*electron;%%/Mn55 = atom('Mn', 25, 25, 55-25); %% Manganese.% Mn = Mn55Mn%Mnpp = Mn - 2*electron;%Mnppp = Mn - 3*electron;%Mnpppp = Mn - 4*electron;Mn%Mnppppppp = Mn - 7*electron;%%*Fe56 = atom('Fe', 26, 26, 56-26); %% Iron.F%Fe57 = Fe56 + neutron;F% Fe = Fe56Fe%Fepp = Fe - 2*electron;%Feppp = Fe - 3*electron;%%,Co59 = atom('Co', 27, 27, 59-27); %% Cobalt.% Co = Co59Co%Copp = Co - 2*electron;%Coppp = Co - 3*electron;%%3'?U% ;3-?V,Ni59 = atom('Ni', 28, 28, 59-28); %% Nickle.% Ni = Ni59Ni%Nipp = Co - 2*electron;%Nippp = Co - 3*electron;%%,Cu64 = atom('Cu', 29, 29, 64-29); %% Copper.% Cu = Cu64Cu%Cup = Cu - electron;%Cupp = Cu - 2*electron;%%*Zn65 = atom('Zn', 30, 30, 65-30); %% Zinc.Z% Zn = Zn65Zn%Znpp = Zn - 2*electron;%%-Ga70 = atom('Ga', 31, 31, 70-31); %% Gallium.Ga% Ga = Ga70Ga%Gappp = Ga - 3*electron;%%/Ge73 = atom('Ge', 32, 32, 73-32); %% Germanium.% Ge = Ge73Ge%Gepp = Ge - 2*electron;%Gepppp = Ge - 4*electron;As%%-As75 = atom('As', 33, 33, 75-33); %% Arsenic.As% As = As75As%Asppp = As - 3*electron;%Asppppp = As - 5*electron;A%Asmmm = As + 3*electron;%%.Se79 = atom('Se', 34, 34, 79-34); %% Selenium.S% Se = Se79Se%Sepppp = Se - 4*electron;Se%3'?x% ;3-?ySepppppp = Se - 6*electron;%Semm = Se + 2*electron;%%-Br80 = atom('Br', 35, 35, 80-35); %% Bromine.Br% Br = Br80Kr%%-Kr84 = atom('Kr', 36, 36, 84-36); %% Krypton.Kr% Kr = Kr84;%%%%% Row 5: Rb to Xe.%%.Rb85 = atom('Rb', 37, 37, 85-37); %% Rubidium.R% Rb = Rb85Rb%Rbp = Rb - electron;%%/Sr88 = atom('Sr', 38, 38, 88-38); %% Strontium.% Sr = Sr88;S%Srpp = Sr - 2*electron;%%+Y89 = atom('Y', 39, 39, 89-39); %% Yttrium.%Y = Y89;%Yppp = Y - 3*electron;Z%%/Zr91 = atom('Zr', 40, 40, 91-40); %% Zirconium.% Zr = Zr91;Z%Zrpppp = Zr - 4*electron;Nb%%,Nb93 = atom('Nb', 41, 41, 93-41); %%Niobium.% Nb = Nb93;N%Nbppp = Nb - 3*electron;%Nbppppp = Nb - 5*electron;M%%3'?% ;3-?0Mo96 = atom('Mo', 42, 42, 96-54); %% Molybdenum.% Mo = Mo96Mo%Mopppppp = Mo - 6*electron;%%0Tc98 = atom('Tc', 43, 43, 98-43); %% Technetium.% Tc = Tc98Tc%Tcpppp = Tc - 4*electron;Tc%Tcpppppp = Tc - 6*electron;%Tcppppppp = Tc - 7*electron;%%1Ru101 = atom('Ru', 44, 44, 101-44); %% Rutherium.Ru% Ru = Ru101R%Ruppp = Ru - 3*electron;%%/Rh103 = atom('Rh', 45, 45, 103-45); %% Rhenium.% Rh = Rh103R%Rhppp = Rh - 3*electron;%%1Pd106 = atom('Pd', 46, 46, 106-46); %% Palladium.Pd% Pd = Pd106P%Pdpp = Pd - 2*electron;%%.Ag108 = atom('Ag', 47, 47, 108-47); %% Silver.A% Ag = Ag108A%Abp = Ag - electron;%%/Cd112 = atom('Cd', 48, 48, 112-48); %% Cadmium.% Cd = Cd112C%Cdpp = Cd - 2*electron;%%.In115 = atom('In', 49, 49, 115-49); %% Indium.I% In = In115I%3'?% ;3-?Inppp = In - 3*electron;%%+Sn119 = atom('Sn', 50, 50, 119-50); %% Tin.% Sn = Sn119S%Snpp = Sn - 2*electron;%Snpppp = Sn - 4*electron;Sb%%0Sb122 = atom('Sb', 51, 51, 122-51); %% Antimony.% Sb = Sb122S%Sbppp = Sb - 3*electron;%Sbppppp = Sb - 5*electron;S%Sbmmm = Sb + 2*electron;%%1Te128 = atom('Te', 52, 52, 128-52); %% Tellurium.Te% Te = Te128T%Tepppp = Te - 4*electron;Te%Tepppppp = Te - 6*electron;%Temm = Te + 2*electron;%%,I127 = atom('I', 53, 53, 127-53); %% Iodine.%I = I127%Ip = I - electron;I%Ippppp = I - 5*electron;%Ippppppp = I - 7*electron;I%Im = I + electron;X%%-Xe131 = atom('Xe', 54, 54, 131-54); %% Xenon.Xe% Xe = Xe131%%%%% Row 6: Cs to Rn.%%.Cs133 = atom('Cs', 55, 55, 133-55); %% Cesium.C%3'?% ;3-? Cs = Cs133C%Csp = Cs - electron;%%.Ba137 = atom('Ba', 56, 56, 137-56); %% Barium.B% Ba = Ba137B%Bapp = Ba - 2*electron;%%1La139 = atom('La', 57, 57, 139-57); %% Lanthanum.La% La = La139L%Lappp = La - 3*electron;%%/Hf178 = atom('Hf', 72, 72, 178-72); %% Hafnium.% Hf = Hf178H%Hfpppp = Hf - 3*electron;Ta%%0Ta181 = atom('Ta', 73, 73, 181-73); %% Tantalum.% Ta = Ta181T%Tappppp = Ta - 5*electron;W%%.W184 = atom('W', 74, 74, 184-74); %% Tungsten.W%W = W184%Wpppppp = W - 5*electron;Re%%/Re186 = atom('Re', 75, 75, 186-75); %% Rhenium.% Re = Re186R%Repppp = Re - 4*electron;Re%Repppppp = Re - 6*electron;%Reppppppp = Re - 7*electron;%%.Os190 = atom('Os', 76, 76, 190-76); %% Osmium.O% Os = Os190O%Osppp = Os - 3*electron;%3'?% ;3-?Ospppp = Os - 4*electron;Ir%%/Ir192 = atom('Ir', 77, 77, 192-77); %% Iridium.% Ir = Ir192I%Irppp = Ir - 3*electron;%Irpppp = Ir - 4*electron;Pt%%0Pt195 = atom('Pt', 78, 78, 195-78); %% Platinum.% Pt = Pt195P%Ptpp = Pt - 2*electron;%Ptpppp = Pt - 4*electron;Au%%,Au197 = atom('Au', 79, 79, 197-79); %% Gold.% Au = Au197A%Aup = Au - electron;%Auppp = Au - 3*electron;%%/Hg201 = atom('Hg', 80, 80, 201-80); %% Mercury.% Hg = Hg201H%Hgp = Hg - electron;%Hgpp = Hg - 2*electron;%%0Tl204 = atom('Tl', 81, 81, 204-81); %% Thallium.% Tl = Tl204T%Tlp = Tl - electron;%Tlppp = Tl - 3*electron;%%,Pb207 = atom('Pb', 82, 82, 207-82); %% Lead.% Pb = Pb207P%Pbpp = Pb - 2*electron;%Pbpppp = Pb - 4*electron;Bi%%3'?'% ;3-?(/Bi209 = atom('Bi', 83, 83, 209-83); %% Bismuth.% Bi = Bi209B%Bippp = Bi - 3*electron;%Bippppp = Bi - 5*electron;P%%1Po209 = atom('Po', 84, 84, 209-84); %% Pollonium.Po% Po = Po209P%Popp = Po - 2*electron;%Popppp = Po - 3*electron;At%%0At210 = atom('At', 85, 85, 210-85); %% Astatine.% At = At210R%%-Rn222 = atom('Rn', 86, 86, 222-86); %% Radon.Rn% Rn = Rn222%%%%% Row 7: Fr to Uns.%%0Fr223 = atom('Fr', 87, 87, 223-87); %% Francium.% Fr = Fr223F%Frp = Fr - electron;%%.Ra226 = atom('Ra', 88, 88, 226-88); %% Radium.R% Ra = Ra226R%Ra = Ra - 2*electron;Ac%%0Ac227 = atom('Ac', 89, 89, 227-89); %% Actinium.% Ac = Ac227A%Ac = Ac - 3*electron;Un%%6Unq261 = atom('Unq', 104, 104, 261-104); %% Unnamed q.U% Unq = Unq261%3'?J% ;3-?K%6Unp262 = atom('Unp', 105, 105, 262-105); %% Unnamed p.U% Unp = Unp262%%6Unh263 = atom('Unh', 106, 106, 263-106); %% Unnamed h.U% Unh = Unh263%%6Uns262 = atom('Uns', 107, 107, 262-107); %% Unnamed s.U% Uns = Uns262%%%% Lanthanides: Ce to Lu.Ce%%.Ce140 = atom('Ce', 58, 58, 140-58); %% Cerium.C% Ce = Ce140C%Cepppp = Ce - 3*electron;Ce%Ceppppp = Ce - 4*electron;P%%4Pr141 = atom('Pr', 59, 59, 141-59); %% Praseodymium.% Pr = Pr141P%Prppp = Pr - 3*electron;%%1Nd144 = atom('Nd', 60, 60, 144-60); %% Neodymium.Nd% Nd = Nd144N%Ndppp = Nd - 3*electron;%%2Pm145 = atom('Pm', 61, 61, 145-61); %% Promethium.P% Pm = Pm145P%Pmppp = Pm - 3*electron;%%0Sm150 = atom('Sm', 62, 62, 150-62); %% Samarium.% Sm = Sm150S%Smpp = Sm - 2*electron;%3'?m% ;3-?nSmppp = Sm - 3*electron;%%0Eu152 = atom('Eu', 63, 63, 152-63); %% Europium.% Eu = Eu152E%Eupp = Eu - 2*electron;%Euppp = Eu - 3*electron;%%2Gd157 = atom('Gd', 64, 64, 157-64); %% Gadolinium.G% Gd = Gd157G%Gdppp = Gd - 3*electron;%%/Tb159 = atom('Tb', 65, 65, 159-65); %% Terbium.% Tb = Tb159T%Tbppp = Tb - 3*electron;%%2Dy162 = atom('Dy', 66, 66, 162-66); %% Dysprosium.D% Dy = Dy162Y%YDyppp = Dy - 3*electron;Ho%%/Ho165 = atom('Ho', 67, 67, 165-67); %% Holmium.% Ho = Ho165H%Hoppp = Ho - 3*electron;%%.Er167 = atom('Er', 68, 68, 167-68); %% Erbium.E% Er = Er167E%Erppp = Er - 3*electron;%%/Tm169 = atom('Tm', 69, 69, 169-69); %% Thulium.% Tm = Tm169T%Tmppp = Tm - 3*electron;%%1Yb173 = atom('Yb', 70, 70, 173-70); %% Ytterbium.Yb%3'?% ;3-? Yb = Yb173Y%Ybpp = Yb - 2*electron;%Ybppp = Yb - 3*electron;%%#Lu175 = atom('Lu', 71, 71, 175-71);% Lu = Lu175L%Luppp = Lu - 3*neutron;%%%% Actinides: Th to Lu.%%/Th232 = atom('Th', 90, 90, 232-90); %% Thorium.% Th = Th232T%Thpppp = Th - 4*electron;Pa%%4Pa231 = atom('Pa', 91, 91, 231-91); %% Protactinium.% Pa = Pa231P%Papppp = Pa - 4*electron;Pa%Pappppp = Pa - 5*electron;U%%-U238 = atom('U', 92, 92, 238-92); %% Uranium.U2%U235 = U238 - 3*neutron;%U236 = U238 - 2*neutron;%U237 = U238 - neutron;U%U = U238%Upppp = U - 3*electron;%Uppppp = U - 4*electron;%Upppppp = U - 5*electron;Up%Uppppppp = U - 6*electron;N%%1Np237 = atom('Np', 93, 93, 237-93); %% Neptunium.Np%"Np = Np237 %% Same as nitrogen+!N%Npppp = Np - 3*electron;%3'?% ;3-?Nppppp = Np - 4*electron;Np%Npppppp = Np - 5*electron;N%Nppppppp = Np - 6*electron;%%1Pu244 = atom('Pu', 94, 94, 244-94); %% Plutonium.Pu% Pu = Pu244P%Puppp = Pu - 3*electron;%Pupppp = Pu - 4*electron;Pu%Puppppp = Pu - 5*electron;P%Pupppppp = Pu - 6*electron;%%1Am243 = atom('Am', 95, 95, 243-95); %% Americium.Am% Am = Am243A%Amppp = Am - 3*electron;%Ampppp = Am - 4*electron;Am%Amppppp = Am - 5*electron;A%Ampppppp = Am - 6*electron;%%.Cm247 = atom('Cm', 96, 96, 247-96); %% Curium.C% Cm = Cm247C%Cmppp = Cm - 3*electron;%%1Bk247 = atom('Bk', 97, 97, 247-97); %% Berkelium.Bk% Bk = Bk247B%Bkppp = Bk - 3*electron;%Bkpppp = Bk - 4*electron;Cf%%3Cf251 = atom('Cf', 98, 98, 251-98); %% Californium.% Cf = Cf251C%Cfppp = Cf - 3*electron;%%3Es252 = atom('Es', 99, 99, 252-99); %% Einsteinium.%3'?% ;3-? Es = Es252E%Esppp = Es - 3*electron;%%2Fm257 = atom('Fm', 100, 100, 257-100); %% Fermium.F% Fm = Fm257F%Fmppp = Fm - 3*electron;%%6Md258 = atom('Md', 101, 101, 258-101); %% Mendelevium.M% Md = Md258M%Mdpp = Md - 2*electron;%Mdppp = Md - 3*electron;%%3No259 = atom('No', 102, 102, 259-102); %% Nobelium.% No = No259N%Nopp = No - 2*electron;%Noppp = No - 3*electron;%%5Lr260 = atom('Lr', 103, 103, 260-103); %% Lawrencium.Lr% Lr = Lr260L%Lrppp = Lr - 3*electron;%%8Rf261 = atom('Rf', 104, 104, 261-104); %% Rutherfordium.% Rf = Rf261H%%2Ha262 = atom('Ha', 105, 105, 262-105); %% Hafnium.H% Ha = Ha262a%%alpha = electron%beta = He - 2*electronh%hydroxyl = Hp + Omm%OHm = hydroxylw%water = 2*Hp + OmmH%3'?% ;3-? HOH = water%heavy_water = 2*Dp + Omm% hydrogen_peroxide = 2*Hp + 2*Omm%hydrogen = 2*Hn%nitrogen = 2*No% oxygen = 2*O%salt = Nap + Clm%ammonia = Nmmmm + 4*Hpl%lime = Nap + OHm%potash = Kp + OHmbu%buckminsterfullerene = 60*C%3'?% ;3-? % ;3-? % ;3-?  compounds.m3'  compounds.m3' compounds%%3'? %;3-?%;3-?%;3-?<%% compounds -- Pre-defined compounds for the "chem" system.%8%% compounds (no argument) defines several compounds by%"%% constructing them from atoms.%% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 25-Oct-1999 12:57:03.%#%% Updated 25-Oct-1999 12:57:03.%%atomsfu%%%% Hydrogen species.%%D = H + neutron;%T = H + 2*neutron;H% Hp = H+1;Dp% Dp = D+1;%%%%%% Familiar ions.Nm%% Nmmmm = N-4;% Omm = O-2;N% Nap = Na+1;% Omm = O-2;N% Clm = Cl-1;% Kp = K+1;%%%%%% Energetic particles.%%3'?2% ;3-?3alpha = electron%beta = He - 2*electronh%%%% Familiar compounds.e%%hydroxyl = Hp + Omm%OHm = hydroxylw%water = 2*Hp + OmmH% HOH = water%heavy_water = 2*Dp + Omm% hydrogen_peroxide = 2*Hp + 2*Omm%hydrogen = 2*Hn%nitrogen = 2*No% oxygen = 2*O%salt = Nap + Clm%ammonia = Nmmmm + 4*Hpl%lime = Nap + OHm%potash = Kp + OHmbu%buckminsterfullerene = 60*C%3'?I% ;3-?J% ;3-?K% ;3-?M elements.me3'  elements.me3'elements3'?N%;3-?O%;3-?P%;3-?Q(function theResult = elements(theFormat)%%.%% elements -- Periodic Table of the Elements.%%4%% elements('theFormat') returns an array of "cell"%5%% or "struct" of the elements, where each cell row%%%3%% specifies {symbol number weight valences}. If%7%% "struct" is returned, the fieldnames are 'symbol',%,%% 'number', 'weight'. Default is 'cell'.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 25-Oct-1999 12:00:23.%#%% Updated 26-Oct-1999 11:21:56.%%-%% Reference: Periodic Table of the Elements,%%%*%% CRC Handbook of Chemistry and Physics,%%/%% 73rd Edition, 1992-1993, ed. David R. Lide,%%% CRC Press, Boca Raton.%%%5%% Periodic Table: {symbol, number, weight, valences}if%%&if nargin < 1, theFormat = 'cell'; endt%%theElements = {%'H', 1, 1.00794, [1]%'He', 2, 4.002602, [0]'%'Li', 3, 6.941, [1]%'Be', 4, 9.012182, [2]'%'B', 5, 10.811, [3]%3'?s% ;3-?t'C', 6, 12.011, [2 4 -4]%&'N', 7, 14.00674, [1 2 3 4 5 -1 -2 -3]'%'O', 8, 15.9994, [-2]'F%'F', 9, 18.9984032, [-1]%'Ne', 10, 20.1797, [0]'%'Na', 11, 22.989768, [1]%'Mg', 12, 24.3050, [2]'%'Al', 13, 26.981539, [3]%'Si', 14, 28.0855, [2 4 -4]%'P', 15, 30.97362, [3 5 -3]%'S', 16, 32.066, [4 6 -2]'C%'Cl', 17, 35.4527, [-1]%'Ar', 18, 39.948, [0]'K%'K', 19, 39.0983, [1]'C%'Ca', 20, 40.078, [2]'S%'Sc', 21, 44.955910, [3]%'Ti', 22, 47.88, [2 3 4]%'V', 23, 50.9415, [2 3 4 5]%'Cr', 24, 51.9961, [2 3 6]'%'Mn', 25, 54.93085, [2 3 4 7]'F%'Fe', 26, 55.847, [2 3]%'Co', 27, 58.93320, [2 3]'N%'Ni', 28, 58.6934, [2 3]%'Cu', 29, 63.546, [1 2]%'Zn', 30, 65.39, [2]%'Ga', 31, 69.723, [3]'G%'Ge', 32, 72.61, [2 4]'%'As', 33, 74.92159, [3 5 -3]%'Se', 34, 78.96, [4 6 -2]'B%'Br', 35, 79.904, [1 5 -1]'%'Kr', 36, 83.80, [0]%'Rb', 37, 85.4678, [1]'%3'?% ;3-?'Sr', 38, 87.62, [2]%'Y', 39, 88.90585, [3]'%'Zr', 40, 91.224, [4]'N%'Nb', 41, 92.90638, [3 5]'M%'Mo', 42, 95.94, [6]%'Tc', 43, 98, [4 6 7]'R%'Ru', 44, 101.07, [3]'R%'Rh', 45, 102.90550, [3]%'Pd', 46, 106.42, [2 4]%'Ag', 47, 107.8682, [1]%'Cd', 48, 112.411, [2]'%'In', 49, 114.82, [3]'S%'Sn', 50, 118.710, [2 4]%'Sb', 51, 121.757, [3 5 -3]%'Te', 52, 127.60, [4 6 -2]'%'I', 53, 126.90447, [1 5 7 -1]'%'Xe', 54, 131.29, [0]'C%'Cs', 55, 132.90543, [1]%'Ba', 56, 137.327, [2]'%'La', 57, 138.9055, [3]%'Hf', 72, 178.49, [4]'T%'Ta', 73, 180.9479, [5]%'W', 74, 183.85, [6]%'Re', 75, 186.207, [4 6 7]'%'Os', 76, 190.2, [3 4]'%'Ir', 77, 192.22, [3 4]%'Pt', 78, 195.08, [2 4]%'Au', 79, 196.96654, [1 3]'%'Hg', 80, 200.59, [1 2]%'Tl', 81, 204.3833, [1 3]'P%'Pb', 82, 207.2, [2 4]'%'Bi', 83, 208.98037, [3 5]'%3'?% ;3-?'Po', 84, 209, [2 4]%'At', 85, 210, []'R%'Rn', 86, 222, [0]'%'Fr', 87, 223, [1]'%'Ra', 88, 226.025, [2]'%'Ac', 89, 227.028, [3]'%/'UNQ', 104, 261, [4] %% Note uppercase symbol.%/'UNP', 105, 262, [] %% Note uppercase symbol.%/'UNH', 106, 263, [] %% Note uppercase symbol.%/'UNS', 107, 262, [] %% Note uppercase symbol.%'Ce', 58, 140.115, [3 4]%'Pr', 59, 140.90765, [3]%'Nd', 60, 144.24, [3]'P%'Pm', 61, 145, [3]'%'Sm', 62, 150.36, [2 3]%'Eu', 63, 151.965, [2 3]%'Gd', 64, 157.25, [3]'T%'Tb', 65, 158.92534, [3]%'Dy', 66, 162.50, [3]'H%'Ho', 67, 164.93032, [3]%'Er', 68, 167.26, [3]'T%'Tm', 69, 168.93421, [3]%'Yb', 70, 173.04, [2 3]%'Lu', 71, 174.967, [3]'%'Th', 90, 232.0381, [4]%'Pa', 91, 231.03588, [4 5]'%'U', 92, 238.0289, [3 4 5 6]%<'Npt', 93, 237.048, [3 4 5 6] %% Note Npt, rather than Np.%'Pu', 94, 244, [3 4 5 6]%'Am', 95, 243, [3 4 5 6]%'Cm', 96, 247, [3]'%'Bk', 97, 247, [3 4]%3'?% ;3-?'Cf', 98, 251, [3]'%'Es', 99, 252, [3]'%'Fm', 100, 257, [3]%'Md', 101, 258, [2 3]'N%'No', 102, 259, [2 3]'L%'Lr', 103, 260, [3]%};i%%if isequal(theFormat, 'struct')% [m, n] = size(theElements);% for i = m:-1:1%" s(i).symbol = theElements{i, 1}; %" s(i).number = theElements{i, 2}; %" s(i).weight = theElements{i, 3}; %$ s(i).valences = theElements{i, 4};% end% theElements = s;if%end%%if nargout > 0 % theResult = theElements;el%else% disp(theElements) %' assignin('caller', 'ans', theElements)%end%3'?% ;3-?% ;3-?% ;3-? makedir.mdo3'  makedir.mdo3'makedir3'?%;3-?%;3-?%;3-?function makedir(varargin)%%#%% makedir -- Make a new directory.%B%% makedir('thePath') creates a new sub-directory named 'thePath'%%?%% (no embellishments), located within the current directory.%>%% A dialog is invoked if manual intervention is needed. No%%=%% action is taken if the desired directory already exists.%%%=%% The "present-working-directory" itself remains the same.%%%<%% makedir "p q r" assumes that the arguments represent one%5%% path-name with single-blanks between components.%%%1%% makedir p q r is the same as makedir "p q r".%%%%6%% Copyright (C) 1996-7 Dr. Charles R. Denham, ZYDECO.%%%% All Rights Reserved.%9%% Disclosure without written explicit consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 08-Jul-1997 08:36:09.%#%% Revised 04-Nov-1998 21:57:53.%#%% Revised 05-Nov-1998 15:24:50.%%+if nargin < 1, help(mfilename), return, end%% thePath = '';fo%for i = 1:length(varargin) %) if i > 1, thePath = [thePath ' ']; end %# thePath = [thePath varargin{i}];%end%%6if thePath(1) == '"' & thePath(length(thePath)) == '"' %* thePath = thePath(2:length(thePath)-1);i%end%3'?#% ;3-?$% itExists = 1;tr%trystr = 'cd(thePath); cd ..';c%catchstr = 'itExists = 0;';%eval(trystr, catchstr)i% if itExists%8 disp([' ## Directory already exists: "' thePath '"'])% returnla%end%% lasterr('')%*warn = 'warning(lasterr); lasterr('''');';t%% thePWD = pwd;if%$if thePWD(length(thePWD)) == filesep% thePWD(length(thePWD)) = '';%end%%5if exist('mkdir', 'builtin') | exist('mkdir', 'file') %+ theCommand = ['mkdir(''' thePath ''')'];%& elseif any(findstr(computer, 'MAC')) %/ theCommand = ['newfolder(''' thePath ''')'];%& elseif any(findstr(computer, 'VMS')) %C theCommand = ['!create/directory "' thePWD filesep thePath '"'];% else %8 theCommand = ['!mkdir "' thePWD filesep thePath '"'];%end%%disp([' ## ' theCommand])ev%eval(theCommand, warn)t%%,trystr = 'itExists = 1; cd(thePath); cd ..';%3'?F% ;3-?Gcatchstr = 'itExists = 0;';%eval(trystr, catchstr)i%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% returnla%end%%,thePrompt = ['Make New ' thePath ' Folder'];%%theInstruction = 'Create, Then Save';wh%while ~itExists%. if any(uisetdir(thePrompt, theInstruction)) % cd ..% eval(trystr, catchstr)% else % break% end % thePrompt = [thePrompt '!'];%end%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% else %0 disp([' ## Unable to create: "' thePath '"'])%end%%-function theResult = newfolder(theFolderName)%%%%.%% newfolder -- Create a new Macintosh folder.%%6%% newfolder('theFolderName') creates a new Macintosh%%8%% folder of 'theFolderName' in the current directory.%5%% The current directory setting remains unchanged.%%%3'?i% ;3-?j6%% If the folder already exists, no action is taken.%%6%% The result is logical(1) if successful; otherwise%%%% it is logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 05-Sep-1997 17:01:27.%%4%% The applescript commands in file "newfolder.mac".%%%%%0%% set theTarget to thePath & ":" & theNewFolder%&%% if not (exists item theTarget) then%%'%% make new folder at folder thePath%L%% set name of folder "untitled folder" of folder thePath to theNewFolder% %% end ifif%% if nargin < 1 % help(mfilename)i% returnla%end%%!if ~any(findstr(computer, 'MAC')) %N disp([' ## No action taken: "' mfilename '" requires Macintosh computer.'])t% returnla%end%%thePath = pwd;w%)while thePath(length(thePath)) == filesep %! thePath(length(thePath)) = '';th%3'?% ;3-?end%thePath = ['"' thePath '"'];%%'theNewFolder = ['"' theFolderName '"'];%%2result = feval('applescript', 'newfolder.mac', ... %> 'thePath', thePath, 'theNewFolder', theNewFolder);i%%&if ~isempty(result), disp(result), endr%%"result = logical(isempty(result));i%%'if nargout > 0, theResult = result; end%%8function theStatus = uisetdir(thePrompt, theInstruction)%%6%% uisetdir -- Open the destination folder via dialog.%%D%% uisetdir('thePrompt', 'theInstruction') presents the "uiputfile"%D%% dialog with 'thePrompt' and 'theInstruction', for selecting the%C%% desired destination folder. The returned status is logical(1)%*%% if successful; otherwise, logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 03-Jul-1997 09:16:00.%%=if nargin < 1, thePrompt = 'Open The Destination Folder'; endif%3if nargin < 2,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S@Q@@@Z@@\@@@H@@@]@Z@Y@@[@*@"@"@\@Y@@]@@@]@Z@Y@@T@X@@]@Z@@@]@[@@@A@\@\@Z@@X@@\@]@@\@M@P@@P@@P@@A@*@"@"@\@Y@@]@@@]@Z@Y@@S@Y@@]@Q@[@[@Y@Y@@\@@@]@[@@@A@[@@^@@S@Y@@]@Q@[@[@Y@Y@@\@A@*@"@Y@@[@Y@@@Z@@Y@*@"@F@F@*@"@\@Y@@]@@@]@Z@Y@@U@X@@\@Y@Y@@]@@@]@[@@@]@Z@Y@@T@X@@]@Z@@@C@@@A@M@A@@@C@@@]@Z@Y@@S@Y@@]@Q@[@[@Y@Y@@\@*@"@Z@@Y@@@[@[@]@@@D@Y@@^@Z@@\@]@\@@@Z@@]@Y@@[@@@@]@Z@Y@@U@X@@\@Y@Y@@]@D@@@]@Z@Y@@[@*@"@"@[@@X@@Z@Y@@@@[@Y@@]@@@Y@[@[@Y@Y@@\@@@X@@]@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@*@"@"@\@Y@@]@@@[@X@@[@@Y@@@@[@Y@@@Y@[@[@Y@Y@@\@@@A@]@@[@]@Z@@]@[@Y@@Y@@@Y@[@[@Y@Y@@\@A@@@[@Y@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@@@]@[@@@]@Z@Y@@S@Y@@]@Q@[@[@Y@Y@@\@*@"@Y@@[@Y@@@Z@@Y@*@"@F@F@*@Y@@[@Y@@@]@Y@@[@[@*3'?% ;3-?% ;3-?% ;3-? clear makedirma;3-? makedir @atomcd;3-?cd @atom;3-?atom.ma3' atom.ma3'atom3'?%;3-?%;3-?%;3-?Bfunction theResult = atom(theSymbol, theProtons, theElectrons, ... %! theNeutrons, thePotential)%%%%-%% atom/atom -- Constructor for "atom" class.%%%>%% atom(theSymbol, theProtons, theElectrons, theNeutrons, ...%%@%% thePotential) constructs an atom with the given properties.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:39:30.%#%% Updated 23-Oct-1999 02:52:40.%%%if nargin < 1, theSymbol = 'Nil'; endif%"if nargin < 2, theProtons = 0; endi%$if nargin < 3, theElectrons = 0; end%#if nargin < 4, theNeutrons = 0; end%$if nargin < 5, thePotential = 0; end%%theStruct.itsSymbol = [];th%theStruct.itsProtons = [];t%theStruct.itsElectrons = [];%theStruct.itsNeutrons = [];%%theStruct.itsPotential = []; %% eV.th%%theStruct.itsAmount = []; %% moles.se%% self = class(theStruct, 'atom');%%self.itsSymbol = theSymbol;%self.itsProtons = theProtons;se%3'?% ;3-?!self.itsElectrons = theElectrons;se%self.itsNeutrons = theNeutrons;%!self.itsPotential = thePotential;se%self.itsAmount = 1;%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)% disp(self)%end%3'?% ;3-?% ;3-?% ;3-?!disp.mf3' disp.mf3'disp3'?"%;3-?#%;3-?$%;3-?%function theResult = disp(self)%% %% atom/disp -- Display an atom.%(%% disp(self) displays self, an "atom",%(%% or returns the display as a string.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 01:47:26.%%(s = ['atom(''' self.itsSymbol ''', ' ...%C num2str(self.itsProtons) ', ' num2str(self.itsElectrons) ', ' ...%D num2str(self.itsNeutrons) ', ' num2str(self.itsPotential) ', ' ...% num2str(self.itsAmount) ')'];%%if nargout > 0 % theResult = s;%else% disp(s)%end%3'?@% ;3-?A% ;3-?B% ;3-?D display.mdi3'  display.mdi3'display3'?E%;3-?F%;3-?G%;3-?H"function theResult = display(self)%%%#%% atom/display -- Display an atom.%+%% display(self) displays self, an "atom",%(%% or returns the display as a string.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 01:47:26.%%$s = [inputname(1) ' = ' disp(self)];%%if nargout > 0 % theResult = s;%else% disp(s)%end%3'?`% ;3-?a% ;3-?b% ;3-?dminus.m3' minus.m3'minusfu3'?e%;3-?f%;3-?g%;3-?h'function theResult = minus(self, other)%%1%% atom/minus -- Subtract something from an atom.%%%1%% minus(self, other) subtracts other from self.%%% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:02:11.%#%% Updated 23-Oct-1999 02:02:11.%%+if nargin < 1, help(mfilename), return, end%%switch class(self)c% case 'atom'% switch class(other)% case 'proton' %4 self.itsProtons = self.itsProtons - amount(other);% result = self;% case 'electron'%8 self.itsElectrons = self.itsElectrons - amount(other);% result = self;% case 'neutron'%6 self.itsNeutrons = self.itsNeutrons - amount(other); % result = self;% case 'double' %% Valence.%0 self.itsElectrons = self.itsElectrons + other;% result = self;% otherwiseo% result = self;%3'?% ;3-? end% otherwise r% result = self;%end%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) % disp(result)mt%end%3'?% ;3-?% ;3-?% ;3-?mtimes.m3' mtimes.m3'mtimesf3'?%;3-?%;3-?%;3-?,function theResult = mtimes(self, theFactor)%%3%% atom/mtimes -- Multiply an "atom" by a constant.%3%% mtimes(self, other) multiplies self, an "atom",%%% by theFactor.i% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:02:11.%#%% Updated 23-Oct-1999 02:02:11.%%if isa(self, 'atom')%- self.itsAmount = self.itsAmount * theFactor; s%else% self = mtimes(theFactor, self);%end%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)% disp(self)%end%3'?% ;3-?% ;3-?% ;3-?number.m3' number.m3'numberf3'?%;3-?%;3-?%;3-?!function theResult = number(self)%%%% %% atom/number -- Atomic number.%*%% number(self) returns the atomic number%%%% of self, an atom.%% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:45:38.%#%% Updated 23-Oct-1999 02:45:38.%%+if nargin < 1, help(mfilename), return, end%%result = self.itsProtons;pl%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) % disp(result)mt%end%3'?% ;3-?% ;3-?% ;3-?plus.mp3' plus.mp3'plus3'?%;3-?%;3-?%;3-?&function theResult = plus(self, other)%%%)%% atom/plus -- Add something to an atom.%%%)%% plus(self, other) adds self to other.%%% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:02:11.%#%% Updated 26-Oct-1999 11:11:26.%%+if nargin < 1, help(mfilename), return, end%%switch class(self)c% case 'atom'% switch class(other)% case {'atom', 'compound'} %! result = compound(self, other); % case 'proton' %4 self.itsProtons = self.itsProtons + amount(other);% result = self;% case 'electron'%8 self.itsElectrons = self.itsElectrons + amount(other);% result = self;% case 'neutron'%6 self.itsNeutrons = self.itsNeutrons + amount(other); % result = self;% case 'double' %% Valence.%0 self.itsElectrons = self.itsElectrons - other;% result = self;%3'? % ;3-?  case 'char' %% Symbol. % self.itsSymbol = other; r% result = self;% otherwiseo% result = self;% end% otherwise r% result = plus(other, self);%end%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) % disp(result)mt%end%3'?% ;3-? % ;3-?!% ;3-?# subsref.msu3'  subsref.msu3'subsref3'?$%;3-?%%;3-?&%;3-?'-function theResult = subsref(self, theStruct)%%%%;%% atom/subsref -- Process subscript references to an atom.%=%% self(k) returns self, an atom, with its valence set to k.%%% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 23:48:27.%#%% Updated 23-Oct-1999 23:48:27.%%theType = theStruct(1).type;%theSubs = theStruct(1).subs;%-if ~iscell(theSubs), theSubs = {theSubs}; endre%%result = self;s%%switch theTypec%case '()' %% Set valence. i% if length(theSubs) > 0% result = self + theSubs{1};ca% end% case '{}'ca%case '.'%end%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) %3'?I% ;3-?J disp(result)mt%end%3'?O% ;3-?P% ;3-?Q% ;3-?Stimes.m3' times.m3'timesfu3'?T%;3-?U%;3-?V%;3-?W+function theResult = times(self, theFactor)%%2%% atom/times -- Multiply an "atom" by a constant.%%2%% times(self, other) multiplies self, an "atom", %%% by theFactor.i% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:02:11.%#%% Updated 23-Oct-1999 02:02:11.%%if isa(self, 'atom')%. self.itsAmount = self.itsAmount .* theFactor; %else% self = times(theFactor, self);%end%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)%end%3'?s% ;3-?t% ;3-?u% ;3-?w valence.mva3'  valence.mva3'valence3'?x%;3-?y%;3-?z%;3-?{"function theResult = valence(self)%%%&%% atom/valence -- Valence of an atom.%%7%% valence(self) returns the valence of self, an atom.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:45:38.%#%% Updated 23-Oct-1999 02:45:38.%%+if nargin < 1, help(mfilename), return, end%%-result = self.itsProtons - self.itsElectrons;ve%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) % disp(result)mt%end%3'?% ;3-?% ;3-?% ;3-? version.mve3'  version.mve3'version3'?%;3-?%;3-?%;3-?function version(self)%%%#%% Version of 26-Oct-1999 13:48:48.%% helpdlg(help(mfilename, 'atom'))%3'?% ;3-?% ;3-?% ;3-?weight.m3' weight.m3'weightf3'?%;3-?%;3-?%;3-?!function theResult = weight(self)%%%% %% atom/weight -- Atomic weight.%*%% weight(self) returns the atomic weightr%%% of self, an atom.%% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:45:38.%#%% Updated 23-Oct-1999 02:45:38.%%+if nargin < 1, help(mfilename), return, end%%,result = self.itsProtons + self.itsNeutrons;%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) % disp(result)mt%end%3'?% ;3-?% ;3-?% ;3-?cd ..ma;3-? makedir.mdo3'  makedir.mdo3'makedir3'?%;3-?%;3-?%;3-?function makedir(varargin)%%#%% makedir -- Make a new directory.%B%% makedir('thePath') creates a new sub-directory named 'thePath'%%?%% (no embellishments), located within the current directory.%>%% A dialog is invoked if manual intervention is needed. No%%=%% action is taken if the desired directory already exists.%%%=%% The "present-working-directory" itself remains the same.%%%<%% makedir "p q r" assumes that the arguments represent one%5%% path-name with single-blanks between components.%%%1%% makedir p q r is the same as makedir "p q r".%%%%6%% Copyright (C) 1996-7 Dr. Charles R. Denham, ZYDECO.%%%% All Rights Reserved.%9%% Disclosure without written explicit consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 08-Jul-1997 08:36:09.%#%% Revised 04-Nov-1998 21:57:53.%#%% Revised 05-Nov-1998 15:24:50.%%+if nargin < 1, help(mfilename), return, end%% thePath = '';fo%for i = 1:length(varargin) %) if i > 1, thePath = [thePath ' ']; end %# thePath = [thePath varargin{i}];%end%%6if thePath(1) == '"' & thePath(length(thePath)) == '"' %* thePath = thePath(2:length(thePath)-1);i%end%3'?% ;3-?% itExists = 1;tr%trystr = 'cd(thePath); cd ..';c%catchstr = 'itExists = 0;';%eval(trystr, catchstr)i% if itExists%8 disp([' ## Directory already exists: "' thePath '"'])% returnla%end%% lasterr('')%*warn = 'warning(lasterr); lasterr('''');';t%% thePWD = pwd;if%$if thePWD(length(thePWD)) == filesep% thePWD(length(thePWD)) = '';%end%%5if exist('mkdir', 'builtin') | exist('mkdir', 'file') %+ theCommand = ['mkdir(''' thePath ''')'];%& elseif any(findstr(computer, 'MAC')) %/ theCommand = ['newfolder(''' thePath ''')'];%& elseif any(findstr(computer, 'VMS')) %C theCommand = ['!create/directory "' thePWD filesep thePath '"'];% else %8 theCommand = ['!mkdir "' thePWD filesep thePath '"'];%end%%disp([' ## ' theCommand])ev%eval(theCommand, warn)t%%,trystr = 'itExists = 1; cd(thePath); cd ..';%3'? % ;3-? catchstr = 'itExists = 0;';%eval(trystr, catchstr)i%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% returnla%end%%,thePrompt = ['Make New ' thePath ' Folder'];%%theInstruction = 'Create, Then Save';wh%while ~itExists%. if any(uisetdir(thePrompt, theInstruction)) % cd ..% eval(trystr, catchstr)% else % break% end % thePrompt = [thePrompt '!'];%end%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% else %0 disp([' ## Unable to create: "' thePath '"'])%end%%-function theResult = newfolder(theFolderName)%%%%.%% newfolder -- Create a new Macintosh folder.%%6%% newfolder('theFolderName') creates a new Macintosh%%8%% folder of 'theFolderName' in the current directory.%5%% The current directory setting remains unchanged.%%%3'? 9% ;3-? :6%% If the folder already exists, no action is taken.%%6%% The result is logical(1) if successful; otherwise%%%% it is logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 05-Sep-1997 17:01:27.%%4%% The applescript commands in file "newfolder.mac".%%%%%0%% set theTarget to thePath & ":" & theNewFolder%&%% if not (exists item theTarget) then%%'%% make new folder at folder thePath%L%% set name of folder "untitled folder" of folder thePath to theNewFolder% %% end ifif%% if nargin < 1 % help(mfilename)i% returnla%end%%!if ~any(findstr(computer, 'MAC')) %N disp([' ## No action taken: "' mfilename '" requires Macintosh computer.'])t% returnla%end%%thePath = pwd;w%)while thePath(length(thePath)) == filesep %! thePath(length(thePath)) = '';th%3'? \% ;3-? ]end%thePath = ['"' thePath '"'];%%'theNewFolder = ['"' theFolderName '"'];%%2result = feval('applescript', 'newfolder.mac', ... %> 'thePath', thePath, 'theNewFolder', theNewFolder);i%%&if ~isempty(result), disp(result), endr%%"result = logical(isempty(result));i%%'if nargout > 0, theResult = result; end%%8function theStatus = uisetdir(thePrompt, theInstruction)%%6%% uisetdir -- Open the destination folder via dialog.%%D%% uisetdir('thePrompt', 'theInstruction') presents the "uiputfile"%D%% dialog with 'thePrompt' and 'theInstruction', for selecting the%C%% desired destination folder. The returned status is logical(1)%*%% if successful; otherwise, logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 03-Jul-1997 09:16:00.%%=if nargin < 1, thePrompt = 'Open The Destination Folder'; endif%3if nargin < 2, theInstruction = 'Save If Okay'; end%%3'? % ;3-? theFile = 0; thePath = 0;[t%:[theFile, thePath] = uiputfile(theInstruction, thePrompt);s%%status = 0; % if isstr(thePath) & any(thePath)% status = 1; %% eval('cd(thePath)', 'status = 0;')if%end%%1if nargout > 0, theStatus = any(any(status)); endne%3'? % ;3-? % ;3-? % ;3-?  newfolder.mac453'  newfolder.mac453' newfolder.mac453'? %;3-? %;3-? %;3-? @F@F@*@F@F@@@P@\@Y@@X@@]@Y@@@@X@@@@[@Y@@]@@@Y@[@[@Y@Y@@\@G@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X@@]@Z@@@C@@@A@M@A@@@C@@@]@Z@Y@@S@Y@@]@Q@[@[@Y@Y@@\@*@"@Z@@Y@@@[@[@]@@@D@Y@@^@Z@@\@]@\@@@Z@@]@Y@@[@@@@]@Z@Y@@U@X@@\@Y@Y@@]@D@@@]@Z@Y@@[@*@"@"@[@@X@@Z@Y@@@@[@Y@@]@@@Y@[@[@Y@Y@@\@@@X@@]@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@*@"@"@\@Y@@]@@@[@X@@[@@Y@@@@[@Y@@@Y@[@[@Y@Y@@\@@@A@]@@[@]@Z@@]@[@Y@@Y@@@Y@[@[@Y@Y@@\@A@@@[@Y@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@@@]@[@@@]@Z@Y@@S@Y@@]@Q@[@[@Y@Y@@\@*@"@Y@@[@Y@@@Z@@Y@*@"@F@F@*@Y@@[@Y@@@]@Y@@[@[@*3'? % ;3-? % ;3-? % ;3-?  clear makedirma;3-? makedir @compoundcd;3-?  cd @compound;3-?  compound.mc3'  compound.mc3'compound3'? %;3-? %;3-? %;3-? *function theResult = compound(this, other)%%%9%% compound/compound -- Constructor for "compound" class.%%%8%% compound(this, other) constructs a compound from the%4%% two arguments, which may be atoms or compounds.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:52:09.%#%% Updated 23-Oct-1999 01:52:09.%%theStruct.itsLeftChild = [];%theStruct.itsRightChild = [];th%theStruct.itsAmount = [];se%%$self = class(theStruct, 'compound');%%,if nargin > 0, self.itsLeftChild = this; end%.if nargin > 1, self.itsRightChild = other; end%%%self.itsAmount = 1;%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)% disp(self)%end%3'? % ;3-? % ;3-? % ;3-? disp.mf3' disp.mf3'disp3'? %;3-? %;3-? %;3-? function theResult = disp(self)%%'%% compound/disp -- Display a compound.%+%% disp(self) displays self, a "compound".% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 14:04:10.%%=s = [disp(self.itsLeftChild) ' + ' disp(self.itsRightChild)];%%%%if nargout > 0 % theResult = s;%else% disp(s)%end%3'? % ;3-? % ;3-? % ;3-?  display.mdi3'  display.mdi3'display3'? %;3-? %;3-? %;3-? "function theResult = display(self)%%%+%% compound/display -- Display an compound.%/%% display(self) displays self, an "compound".% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 01:47:26.%%$s = [inputname(1) ' = ' disp(self)];%%if nargout > 0 % theResult = s;%else% disp(s)%end%3'? % ;3-? % ;3-? % ;3-? mtimes.m3' mtimes.m3'mtimesf3'? !%;3-? "%;3-? #%;3-? $,function theResult = mtimes(self, theFactor)%%7%% compound/mtimes -- Multiply an "atom" by a constant.%6%% mtimes(self, other) multiplies self, a "compound",i%%% by theFactor.i% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:02:11.%#%% Updated 23-Oct-1999 02:02:11.%%if isa(self, 'compound')%- self.itsAmount = self.itsAmount * theFactor; s%else% self = mtimes(theFactor, self);%end%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)% disp(self)%end%3'? A% ;3-? B% ;3-? C% ;3-? Enumber.m3' number.m3'numberf3'? F%;3-? G%;3-? H%;3-? I!function theResult = number(self)%%%%=%% compound/number -- Cumulative atomic number of a compound.%%%>%% number(self) returns the cumulative atomic number of self,%%%% a compound.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:45:38.%#%% Updated 23-Oct-1999 02:45:38.%%+if nargin < 1, help(mfilename), return, end%%#result = number(self.itsLeftChild);%if ~isempty(self.itsRightChild)%. result = result + number(self.itsRightChild);%%end%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) % disp(result)mt%end%3'? g% ;3-? h% ;3-? i% ;3-? kplus.mp3' plus.mp3'plus3'? l%;3-? m%;3-? n%;3-? o&function theResult = plus(self, other)%%%"%% atom/plus -- Add two compounds.%%-%% plus(self, other) adds self to other, one%%%.%% a compound, to create a another compound.r% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:02:11.%#%% Updated 23-Oct-1999 02:02:11.%%+if nargin < 1, help(mfilename), return, end%%result = compound(self, other);%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) %end%3'? % ;3-? % ;3-? % ;3-?  valence.mva3'  valence.mva3'valence3'? %;3-? %;3-? %;3-? "function theResult = valence(self)%%%-%% compound/valence -- Valence of a compound.%%%:%% valence(self) returns the valence of self, a compound.r% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:45:38.%#%% Updated 23-Oct-1999 02:45:38.%%+if nargin < 1, help(mfilename), return, end%%-result = self.itsProtons - self.itsElectrons;ve%%$result = valence(self.itsLeftChild);%if ~isempty(self.itsRightChild)%/ result = result + valence(self.itsRightChild);%end%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) % disp(result)mt%end%3'? % ;3-? % ;3-? % ;3-? weight.m3' weight.m3'weightf3'? %;3-? %;3-? %;3-? !function theResult = weight(self)%%%%5%% compound/weight -- Molecular weight of a compound.%%%;%% weight(self) returns the molecular of self, a compound.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:45:38.%#%% Updated 23-Oct-1999 02:45:38.%%+if nargin < 1, help(mfilename), return, end%%#result = weight(self.itsLeftChild);%if ~isempty(self.itsRightChild)%. result = result + weight(self.itsRightChild);m%end%%if nargout > 0 % theResult = result;%else%" assignin('caller', 'ans', result) % disp(result)mt%end%3'? % ;3-? % ;3-? % ;3-? cd ..ma;3-?  makedir.mdo3'  makedir.mdo3'makedir3'? %;3-? %;3-? %;3-? function makedir(varargin)%%#%% makedir -- Make a new directory.%B%% makedir('thePath') creates a new sub-directory named 'thePath'%%?%% (no embellishments), located within the current directory.%>%% A dialog is invoked if manual intervention is needed. No%%=%% action is taken if the desired directory already exists.%%%=%% The "present-working-directory" itself remains the same.%%%<%% makedir "p q r" assumes that the arguments represent one%5%% path-name with single-blanks between components.%%%1%% makedir p q r is the same as makedir "p q r".%%%%6%% Copyright (C) 1996-7 Dr. Charles R. Denham, ZYDECO.%%%% All Rights Reserved.%9%% Disclosure without written explicit consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 08-Jul-1997 08:36:09.%#%% Revised 04-Nov-1998 21:57:53.%#%% Revised 05-Nov-1998 15:24:50.%%+if nargin < 1, help(mfilename), return, end%% thePath = '';fo%for i = 1:length(varargin) %) if i > 1, thePath = [thePath ' ']; end %# thePath = [thePath varargin{i}];%end%%6if thePath(1) == '"' & thePath(length(thePath)) == '"' %* thePath = thePath(2:length(thePath)-1);i%end%3'? % ;3-? % itExists = 1;tr%trystr = 'cd(thePath); cd ..';c%catchstr = 'itExists = 0;';%eval(trystr, catchstr)i% if itExists%8 disp([' ## Directory already exists: "' thePath '"'])% returnla%end%% lasterr('')%*warn = 'warning(lasterr); lasterr('''');';t%% thePWD = pwd;if%$if thePWD(length(thePWD)) == filesep% thePWD(length(thePWD)) = '';%end%%5if exist('mkdir', 'builtin') | exist('mkdir', 'file') %+ theCommand = ['mkdir(''' thePath ''')'];%& elseif any(findstr(computer, 'MAC')) %/ theCommand = ['newfolder(''' thePath ''')'];%& elseif any(findstr(computer, 'VMS')) %C theCommand = ['!create/directory "' thePWD filesep thePath '"'];% else %8 theCommand = ['!mkdir "' thePWD filesep thePath '"'];%end%%disp([' ## ' theCommand])ev%eval(theCommand, warn)t%%,trystr = 'itExists = 1; cd(thePath); cd ..';%3'? #% ;3-? $catchstr = 'itExists = 0;';%eval(trystr, catchstr)i%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% returnla%end%%,thePrompt = ['Make New ' thePath ' Folder'];%%theInstruction = 'Create, Then Save';wh%while ~itExists%. if any(uisetdir(thePrompt, theInstruction)) % cd ..% eval(trystr, catchstr)% else % break% end % thePrompt = [thePrompt '!'];%end%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% else %0 disp([' ## Unable to create: "' thePath '"'])%end%%-function theResult = newfolder(theFolderName)%%%%.%% newfolder -- Create a new Macintosh folder.%%6%% newfolder('theFolderName') creates a new Macintosh%%8%% folder of 'theFolderName' in the current directory.%5%% The current directory setting remains unchanged.%%%3'? F% ;3-? G6%% If the folder already exists, no action is taken.%%6%% The result is logical(1) if successful; otherwise%%%% it is logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 05-Sep-1997 17:01:27.%%4%% The applescript commands in file "newfolder.mac".%%%%%0%% set theTarget to thePath & ":" & theNewFolder%&%% if not (exists item theTarget) then%%'%% make new folder at folder thePath%L%% set name of folder "untitled folder" of folder thePath to theNewFolder% %% end ifif%% if nargin < 1 % help(mfilename)i% returnla%end%%!if ~any(findstr(computer, 'MAC')) %N disp([' ## No action taken: "' mfilename '" requires Macintosh computer.'])t% returnla%end%%thePath = pwd;w%)while thePath(length(thePath)) == filesep %! thePath(length(thePath)) = '';th%3'? i% ;3-? jend%thePath = ['"' thePath '"'];%%'theNewFolder = ['"' theFolderName '"'];%%2result = feval('applescript', 'newfolder.mac', ... %> 'thePath', thePath, 'theNewFolder', theNewFolder);i%%&if ~isempty(result), disp(result), endr%%"result = logical(isempty(result));i%%'if nargout > 0, theResult = result; end%%8function theStatus = uisetdir(thePrompt, theInstruction)%%6%% uisetdir -- Open the destination folder via dialog.%%D%% uisetdir('thePrompt', 'theInstruction') presents the "uiputfile"%D%% dialog with 'thePrompt' and 'theInstruction', for selecting the%C%% desired destination folder. The returned status is logical(1)%*%% if successful; otherwise, logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 03-Jul-1997 09:16:00.%%=if nargin < 1, thePrompt = 'Open The Destination Folder'; endif%3if nargin < 2, theInstruction = 'Save If Okay'; end%%3'? % ;3-? theFile = 0; thePath = 0;[t%:[theFile, thePath] = uiputfile(theInstruction, thePrompt);s%%status = 0; % if isstr(thePath) & any(thePath)% status = 1; %% eval('cd(thePath)', 'status = 0;')if%end%%1if nargout > 0, theStatus = any(any(status)); endne%3'? % ;3-? % ;3-? % ;3-?  newfolder.mac453'  newfolder.mac453' newfolder.mac453'? %;3-? %;3-? %;3-? @F@F@*@F@F@@@P@\@Y@@X@@]@Y@@@@X@@@@[@Y@@]@@@Y@[@[@Y@Y@@\@G@*@F@F@*@F@F@@@P@[@\@^@@\@Z@@Y@Z@]@@@D@P@D@@@H@L@L@K@@@Q@\@G@@@P@Z@X@@\@[@Y@@\@@@T@G@@@Q@Y@@[@Z@X@@[@@F@@@V@V@@Q@Q@@P@S@G@*@F@F@@@@@P@@[@[@@@T@Z@@Y@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[@@X@@Z@Y@@@@[@Y@@]@@@Y@[@[@Y@Y@@\@@@X@@]@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@*@"@"@\@Y@@]@@@[@X@@[@@Y@@@@[@Y@@@Y@[@[@Y@Y@@\@@@A@]@@[@]@Z@@]@[@Y@@Y@@@Y@[@[@Y@Y@@\@A@@@[@Y@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@@@]@[@@@]@Z@Y@@S@Y@@]@Q@[@[@Y@Y@@\@*@"@Y@@[@Y@@@Z@@Y@*@"@F@F@*@Y@@[@Y@@@]@Y@@[@[@*3'? % ;3-? % ;3-? % ;3-?  clear makedirma;3-? makedir @electroncd;3-?  cd @electron;3-? amount.m3' amount.m3'amountf3'? %;3-? %;3-? %;3-? !function theResult = amount(self)%%%%&%% electron/amount -- Electron amount.%%9%% amount(self) returns the amount of self, an electron.%%% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 23:35:21.%#%% Updated 23-Oct-1999 23:35:21.%%result = self.itsAmount;%%if nargout > 0 % theResult = result;%else% disp(result)mt%end%3'? % ;3-? % ;3-? % ;3-? disp.mf3' disp.mf3'disp3'? %;3-? %;3-? %;3-? function theResult = disp(self)%%(%% electron/disp -- Display an electron.%,%% disp(self) displays self, an "electron",%(%% or returns the display as a string.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 01:47:26.%%s = class(self);%if self.itsAmount ~= 1 %% s = [num2str(self.itsAmount) '*' s];%%%end%%if nargout > 0 % theResult = s;%else% disp(s)%end%3'? % ;3-? % ;3-? % ;3-?  display.mdi3'  display.mdi3'display3'? %;3-? %;3-? %;3-? "function theResult = display(self)%%%+%% electron/display -- Display an electron.%/%% display(self) displays self, an "electron",%(%% or returns the display as a string.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 01:47:26.%%$s = [inputname(1) ' = ' disp(self)];%%if nargout > 0 % theResult = s;%else% disp(' ')e% disp(s)%end%3'? $% ;3-? %% ;3-? &% ;3-? ( electron.mf3'  electron.mf3'electron3'? )%;3-? *%;3-? +%;3-? ,function theResult = electron%%%%9%% electron/electron -- Constructor for "electron" class.%%%0%% electron (no argument) returns a "electron".% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 03:00:44.%#%% Updated 23-Oct-1999 03:00:44.%%theStruct.itsAmount = [];se%%$self = class(theStruct, 'electron');%%self.itsAmount = 1;%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)%end%3'? G% ;3-? H% ;3-? I% ;3-? Kmtimes.m3' mtimes.m3'mtimesf3'? L%;3-? M%;3-? N%;3-? O,function theResult = mtimes(self, theFactor)%%;%% electron/mtimes -- Multiply an "electron" by a constant.%7%% mtimes(self, other) multiplies self, an "electron",%%% by theFactor.i% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:02:11.%#%% Updated 23-Oct-1999 02:02:11.%%if isa(self, 'electron')%- self.itsAmount = self.itsAmount * theFactor; s%else% self = mtimes(theFactor, self);%end%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)% disp(self)%end%3'? l% ;3-? m% ;3-? n% ;3-? ocd ..ma;3-? q makedir.mdo3'  makedir.mdo3'makedir3'? r%;3-? s%;3-? t%;3-? ufunction makedir(varargin)%%#%% makedir -- Make a new directory.%B%% makedir('thePath') creates a new sub-directory named 'thePath'%%?%% (no embellishments), located within the current directory.%>%% A dialog is invoked if manual intervention is needed. No%%=%% action is taken if the desired directory already exists.%%%=%% The "present-working-directory" itself remains the same.%%%<%% makedir "p q r" assumes that the arguments represent one%5%% path-name with single-blanks between components.%%%1%% makedir p q r is the same as makedir "p q r".%%%%6%% Copyright (C) 1996-7 Dr. Charles R. Denham, ZYDECO.%%%% All Rights Reserved.%9%% Disclosure without written explicit consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 08-Jul-1997 08:36:09.%#%% Revised 04-Nov-1998 21:57:53.%#%% Revised 05-Nov-1998 15:24:50.%%+if nargin < 1, help(mfilename), return, end%% thePath = '';fo%for i = 1:length(varargin) %) if i > 1, thePath = [thePath ' ']; end %# thePath = [thePath varargin{i}];%end%%6if thePath(1) == '"' & thePath(length(thePath)) == '"' %* thePath = thePath(2:length(thePath)-1);i%end%3'? % ;3-? % itExists = 1;tr%trystr = 'cd(thePath); cd ..';c%catchstr = 'itExists = 0;';%eval(trystr, catchstr)i% if itExists%8 disp([' ## Directory already exists: "' thePath '"'])% returnla%end%% lasterr('')%*warn = 'warning(lasterr); lasterr('''');';t%% thePWD = pwd;if%$if thePWD(length(thePWD)) == filesep% thePWD(length(thePWD)) = '';%end%%5if exist('mkdir', 'builtin') | exist('mkdir', 'file') %+ theCommand = ['mkdir(''' thePath ''')'];%& elseif any(findstr(computer, 'MAC')) %/ theCommand = ['newfolder(''' thePath ''')'];%& elseif any(findstr(computer, 'VMS')) %C theCommand = ['!create/directory "' thePWD filesep thePath '"'];% else %8 theCommand = ['!mkdir "' thePWD filesep thePath '"'];%end%%disp([' ## ' theCommand])ev%eval(theCommand, warn)t%%,trystr = 'itExists = 1; cd(thePath); cd ..';%3'? % ;3-? catchstr = 'itExists = 0;';%eval(trystr, catchstr)i%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% returnla%end%%,thePrompt = ['Make New ' thePath ' Folder'];%%theInstruction = 'Create, Then Save';wh%while ~itExists%. if any(uisetdir(thePrompt, theInstruction)) % cd ..% eval(trystr, catchstr)% else % break% end % thePrompt = [thePrompt '!'];%end%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% else %0 disp([' ## Unable to create: "' thePath '"'])%end%%-function theResult = newfolder(theFolderName)%%%%.%% newfolder -- Create a new Macintosh folder.%%6%% newfolder('theFolderName') creates a new Macintosh%%8%% folder of 'theFolderName' in the current directory.%5%% The current directory setting remains unchanged.%%%3'? % ;3-? 6%% If the folder already exists, no action is taken.%%6%% The result is logical(1) if successful; otherwise%%%% it is logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 05-Sep-1997 17:01:27.%%4%% The applescript commands in file "newfolder.mac".%%%%%0%% set theTarget to thePath & ":" & theNewFolder%&%% if not (exists item theTarget) then%%'%% make new folder at folder thePath%L%% set name of folder "untitled folder" of folder thePath to theNewFolder% %% end ifif%% if nargin < 1 % help(mfilename)i% returnla%end%%!if ~any(findstr(computer, 'MAC')) %N disp([' ## No action taken: "' mfilename '" requires Macintosh computer.'])t% returnla%end%%thePath = pwd;w%)while thePath(length(thePath)) == filesep %! thePath(length(thePath)) = '';th%3'? % ;3-? end%thePath = ['"' thePath '"'];%%'theNewFolder = ['"' theFolderName '"'];%%2result = feval('applescript', 'newfolder.mac', ... %> 'thePath', thePath, 'theNewFolder', theNewFolder);i%%&if ~isempty(result), disp(result), endr%%"result = logical(isempty(result));i%%'if nargout > 0, theResult = result; end%%8function theStatus = uisetdir(thePrompt, theInstruction)%%6%% uisetdir -- Open the destination folder via dialog.%%D%% uisetdir('thePrompt', 'theInstruction') presents the "uiputfile"%D%% dialog with 'thePrompt' and 'theInstruction', for selecting the%C%% desired destination folder. The returned status is logical(1)%*%% if successful; otherwise, logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 03-Jul-1997 09:16:00.%%=if nargin < 1, thePrompt = 'Open The Destination Folder'; endif%3if nargin < 2, theInstruction = 'Save If Okay'; end%%3'? #% ;3-? $theFile = 0; thePath = 0;[t%:[theFile, thePath] = uiputfile(theInstruction, thePrompt);s%%status = 0; % if isstr(thePath) & any(thePath)% status = 1; %% eval('cd(thePath)', 'status = 0;')if%end%%1if nargout > 0, theStatus = any(any(status)); endne%3'? 1% ;3-? 2% ;3-? 3% ;3-? 5 newfolder.mac453'  newfolder.mac453' newfolder.mac453'? 6%;3-? 7%;3-? 8%;3-? 9@F@F@*@F@F@@@P@\@Y@@X@@]@Y@@@@X@@@@[@Y@@]@@@Y@[@[@Y@Y@@\@G@*@F@F@*@F@F@@@P@[@\@^@@\@Z@@Y@Z@]@@@D@P@D@@@H@L@L@K@@@Q@\@G@@@P@Z@X@@\@[@Y@@\@@@T@G@@@Q@Y@@[@Z@X@@[@@F@@@V@V@@Q@Q@@P@S@G@*@F@F@@@@@P@@[@[@@@T@Z@@Y@Z@]@\@@@T@Y@@\@Y@@\@]@Y@@Y@G@*@F@F@@@@@@@Q@Z@@\@X@[@[@\@]@@\@Y@@@@]@Z@@]@Z@[@]@@]@@@Y@@^@\@[@Z@@X@Z@@]@@@]@\@Z@@]@]@Y@@[@@@X@[@[@\@Y@@[@]@@@Y@\@[@[@@@@]@Z@Y@@*@F@F@@@@@@@@@X@[@\@^@@\@Z@@Y@Z@]@@@[@]@[@Y@@\@@@Y@[@Y@@\@@@[@[@]@@@X@[@[@\@]@Z@@]@]@@]@Y@@@@\@]@@X@[@Z@@X@X@@]@Z@@[@[@G@*@*@F@F@@@U@Y@@\@\@Z@@[@[@@@[@Y@@@H@J@F@T@Y@@\@F@H@L@L@K@@@H@K@M@J@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cd @neutron;3-? \amount.m3' amount.m3'amountf3'? ]%;3-? ^%;3-? _%;3-? `!function theResult = amount(self)%%%%$%% neutron/amount -- Neutron amount.%7%% amount(self) returns the amount of self, a neutron.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 23:35:21.%#%% Updated 23-Oct-1999 23:35:21.%%result = self.itsAmount;%%if nargout > 0 % theResult = result;%else% disp(result)mt%end%3'? w% ;3-? x% ;3-? y% ;3-? {disp.mf3' disp.mf3'disp3'? |%;3-? }%;3-? ~%;3-? function theResult = disp(self)%%&%% neutron/disp -- Display an neutron.%%*%% disp(self) displays self, a "neutron",%%(%% or returns the display as a string.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 01:47:26.%%s = class(self);%if self.itsAmount ~= 1 %% s = [num2str(self.itsAmount) '*' s];%%%end%%if nargout > 0 % theResult = s;%else% disp(s)%end%3'? % ;3-? % ;3-? % ;3-?  display.mdi3'  display.mdi3'display3'? %;3-? %;3-? %;3-? "function theResult = display(self)%%%(%% neutron/display -- Display a neutron.%-%% display(self) displays self, a "neutron",%%%(%% or returns the display as a string.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 01:47:26.%%$s = [inputname(1) ' = ' disp(self)];%%if nargout > 0 % theResult = s;%else% disp(' ')e% disp(s)%end%3'? % ;3-? % ;3-? % ;3-? mtimes.m3' mtimes.m3'mtimesf3'? %;3-? %;3-? %;3-? ,function theResult = mtimes(self, theFactor)%%8%% neutron/mtimes -- Multiply a "neutron" by a constant.%5%% mtimes(self, other) multiplies self, a "neutron",if%%% by theFactor.i% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:02:11.%#%% Updated 23-Oct-1999 02:02:11.%%if isa(self, 'neutron')%- self.itsAmount = self.itsAmount * theFactor; s%else% self = mtimes(theFactor, self);%end%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)% disp(self)%end%3'? % ;3-? % ;3-? % ;3-?  neutron.mfu3'  neutron.mfu3'neutron3'? %;3-? %;3-? %;3-? function theResult = neutron%%6%% neutron/neutron -- Constructor for "neutron" class.%%.%% neutron (no argument) returns a "neutron".s% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 03:00:44.%#%% Updated 23-Oct-1999 03:00:44.%%theStruct.itsAmount = [];se%%#self = class(theStruct, 'neutron');%%self.itsAmount = 1;%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)%end%3'?% ;3-?% ;3-?% ;3-?cd ..ma;3-? makedir.mdo3'  makedir.mdo3'makedir3'? %;3-? %;3-? %;3-? function makedir(varargin)%%#%% makedir -- Make a new directory.%B%% makedir('thePath') creates a new sub-directory named 'thePath'%%?%% (no embellishments), located within the current directory.%>%% A dialog is invoked if manual intervention is needed. No%%=%% action is taken if the desired directory already exists.%%%=%% The "present-working-directory" itself remains the same.%%%<%% makedir "p q r" assumes that the arguments represent one%5%% path-name with single-blanks between components.%%%1%% makedir p q r is the same as makedir "p q r".%%%%6%% Copyright (C) 1996-7 Dr. Charles R. Denham, ZYDECO.%%%% All Rights Reserved.%9%% Disclosure without written explicit consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 08-Jul-1997 08:36:09.%#%% Revised 04-Nov-1998 21:57:53.%#%% Revised 05-Nov-1998 15:24:50.%%+if nargin < 1, help(mfilename), return, end%% thePath = '';fo%for i = 1:length(varargin) %) if i > 1, thePath = [thePath ' ']; end %# thePath = [thePath varargin{i}];%end%%6if thePath(1) == '"' & thePath(length(thePath)) == '"' %* thePath = thePath(2:length(thePath)-1);i%end%3'?.% ;3-?/% itExists = 1;tr%trystr = 'cd(thePath); cd ..';c%catchstr = 'itExists = 0;';%eval(trystr, catchstr)i% if itExists%8 disp([' ## Directory already exists: "' thePath '"'])% returnla%end%% lasterr('')%*warn = 'warning(lasterr); lasterr('''');';t%% thePWD = pwd;if%$if thePWD(length(thePWD)) == filesep% thePWD(length(thePWD)) = '';%end%%5if exist('mkdir', 'builtin') | exist('mkdir', 'file') %+ theCommand = ['mkdir(''' thePath ''')'];%& elseif any(findstr(computer, 'MAC')) %/ theCommand = ['newfolder(''' thePath ''')'];%& elseif any(findstr(computer, 'VMS')) %C theCommand = ['!create/directory "' thePWD filesep thePath '"'];% else %8 theCommand = ['!mkdir "' thePWD filesep thePath '"'];%end%%disp([' ## ' theCommand])ev%eval(theCommand, warn)t%%,trystr = 'itExists = 1; cd(thePath); cd ..';%3'?Q% ;3-?Rcatchstr = 'itExists = 0;';%eval(trystr, catchstr)i%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% returnla%end%%,thePrompt = ['Make New ' thePath ' Folder'];%%theInstruction = 'Create, Then Save';wh%while ~itExists%. if any(uisetdir(thePrompt, theInstruction)) % cd ..% eval(trystr, catchstr)% else % break% end % thePrompt = [thePrompt '!'];%end%% if itExists%1 disp([' ## Directory created: "' thePath '"'])th% else %0 disp([' ## Unable to create: "' thePath '"'])%end%%-function theResult = newfolder(theFolderName)%%%%.%% newfolder -- Create a new Macintosh folder.%%6%% newfolder('theFolderName') creates a new Macintosh%%8%% folder of 'theFolderName' in the current directory.%5%% The current directory setting remains unchanged.%%%3'?t% ;3-?u6%% If the folder already exists, no action is taken.%%6%% The result is logical(1) if successful; otherwise%%%% it is logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 05-Sep-1997 17:01:27.%%4%% The applescript commands in file "newfolder.mac".%%%%%0%% set theTarget to thePath & ":" & theNewFolder%&%% if not (exists item theTarget) then%%'%% make new folder at folder thePath%L%% set name of folder "untitled folder" of folder thePath to theNewFolder% %% end ifif%% if nargin < 1 % help(mfilename)i% returnla%end%%!if ~any(findstr(computer, 'MAC')) %N disp([' ## No action taken: "' mfilename '" requires Macintosh computer.'])t% returnla%end%%thePath = pwd;w%)while thePath(length(thePath)) == filesep %! thePath(length(thePath)) = '';th%3'?% ;3-?end%thePath = ['"' thePath '"'];%%'theNewFolder = ['"' theFolderName '"'];%%2result = feval('applescript', 'newfolder.mac', ... %> 'thePath', thePath, 'theNewFolder', theNewFolder);i%%&if ~isempty(result), disp(result), endr%%"result = logical(isempty(result));i%%'if nargout > 0, theResult = result; end%%8function theStatus = uisetdir(thePrompt, theInstruction)%%6%% uisetdir -- Open the destination folder via dialog.%%D%% uisetdir('thePrompt', 'theInstruction') presents the "uiputfile"%D%% dialog with 'thePrompt' and 'theInstruction', for selecting the%C%% desired destination folder. The returned status is logical(1)%*%% if successful; otherwise, logical(0).%% %%%4%% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 03-Jul-1997 09:16:00.%%=if nargin < 1, thePrompt = 'Open The Destination Folder'; endif%3if nargin < 2, theInstruction = 'Save If Okay'; end%%3'?% ;3-?theFile = 0; thePath = 0;[t%:[theFile, thePath] = uiputfile(theInstruction, thePrompt);s%%status = 0; % if isstr(thePath) & any(thePath)% status = 1; %% eval('cd(thePath)', 'status = 0;')if%end%%1if nargout > 0, theStatus = any(any(status)); endne%3'?% ;3-?% ;3-?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@S@Y@@]@Q@[@[@Y@Y@@\@A@*@"@Y@@[@Y@@@Z@@Y@*@"@F@F@*@"@\@Y@@]@@@]@Z@Y@@U@X@@\@Y@Y@@]@@@]@[@@@]@Z@Y@@T@X@@]@Z@@@C@@@A@M@A@@@C@@@]@Z@Y@@S@Y@@]@Q@[@[@Y@Y@@\@*@"@Z@@Y@@@[@[@]@@@D@Y@@^@Z@@\@]@\@@@Z@@]@Y@@[@@@@]@Z@Y@@U@X@@\@Y@Y@@]@D@@@]@Z@Y@@[@*@"@"@[@@X@@Z@Y@@@@[@Y@@]@@@Y@[@[@Y@Y@@\@@@X@@]@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@*@"@"@\@Y@@]@@@[@X@@[@@Y@@@@[@Y@@@Y@[@[@Y@Y@@\@@@A@]@@[@]@Z@@]@[@Y@@Y@@@Y@[@[@Y@Y@@\@A@@@[@Y@@@Y@[@[@Y@Y@@\@@@]@Z@Y@@T@X@@]@Z@@@]@[@@@]@Z@Y@@S@Y@@]@Q@[@[@Y@Y@@\@*@"@Y@@[@Y@@@Z@@Y@*@"@F@F@*@Y@@[@Y@@@]@Y@@[@[@*3'?% ;3-?% ;3-?% ;3-? clear makedirma;3-?makedir @proton;3-? cd @proton%;3-?amount.m3' amount.m3'amountf3'?%;3-?%;3-?%;3-?!function theResult = amount(self)%%%%"%% proton/amount -- Proton amount.%%6%% amount(self) returns the amount of self, a proton.%% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 23:35:21.%#%% Updated 23-Oct-1999 23:35:21.%%result = self.itsAmount;%%if nargout > 0 % theResult = result;%else% disp(result)mt%end%3'?% ;3-?% ;3-?% ;3-?disp.mf3' disp.mf3'disp3'?%;3-?%;3-?%;3-?function theResult = disp(self)%%$%% proton/disp -- Display an proton.%)%% disp(self) displays self, a "proton",%%%(%% or returns the display as a string.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 01:47:26.%%s = class(self);%if self.itsAmount ~= 1 %% s = [num2str(self.itsAmount) '*' s];%%%end%%if nargout > 0 % theResult = s;%else% disp(s)%end%3'?1% ;3-?2% ;3-?3% ;3-?5 display.mdi3'  display.mdi3'display3'?6%;3-?7%;3-?8%;3-?9"function theResult = display(self)%%%&%% proton/display -- Display a proton.%%,%% display(self) displays self, a "proton",%(%% or returns the display as a string.% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 01:47:26.%#%% Updated 23-Oct-1999 01:47:26.%%$s = [inputname(1) ' = ' disp(self)];%%if nargout > 0 % theResult = s;%else% disp(' ')e% disp(s)%end%3'?R% ;3-?S% ;3-?T% ;3-?Vmtimes.m3' mtimes.m3'mtimesf3'?W%;3-?X%;3-?Y%;3-?Z,function theResult = mtimes(self, theFactor)%%6%% proton/mtimes -- Multiply a "proton" by a constant.%%4%% mtimes(self, other) multiplies self, a "proton",%%% by theFactor.i% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 02:02:11.%#%% Updated 23-Oct-1999 02:02:11.%%if isa(self, 'proton')p%- self.itsAmount = self.itsAmount * theFactor; s%else% self = mtimes(theFactor, self);%end%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)% disp(self)%end%3'?w% ;3-?x% ;3-?y% ;3-?{proton.m3' proton.m3'protone3'?|%;3-?}%;3-?~%;3-?function theResult = proton%%3%% proton/proton -- Constructor for "proton" class.%,%% proton (no argument) returns a "proton".% %%%4%% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.%%% All Rights Reserved.%9%% Disclosure without explicit written consent from the%%%6%% copyright owner does not constitute publication. % %%%#%% Version of 23-Oct-1999 03:00:44.%#%% Updated 23-Oct-1999 03:00:44.%%theStruct.itsAmount = [];se%%"self = class(theStruct, 'proton'); %%self.itsAmount = 1;%%if nargout > 0 % theResult = self; %else% assignin('caller', 'ans', self)%end%3'?% ;3-?% ;3-?% ;3-?cd ..ma;3-?cd ..ma;3-? %%:3-?8 ## To get started, put the "chem" folder in your Matlab:3-?9 ## path, then execute "compounds" at the Matlab prompt.an:3-G