Changeset 1260
- Timestamp:
- Dec 20, 2008, 2:51:08 PM (16 years ago)
- Location:
- trunk/examples/app-fermi
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/app-fermi/matlab/compiled/fermi.m
r1139 r1260 1 1 % ---------------------------------------------------------------------- 2 % EXAMPLE: Fermi-Dirac function in Matlab.2 % EXAMPLE: Fermi-Dirac function in Octave. 3 3 % 4 4 % This script represents a newly written application with rappture … … 8 8 % AUTHOR: Michael McLennan, Purdue University 9 9 % AUTHOR: Derrick Kearney, Purdue University 10 % Copyright (c) 2004-200 8Purdue Research Foundation10 % Copyright (c) 2004-2007 Purdue Research Foundation 11 11 % 12 12 % See the file "license.terms" for information on usage and … … 14 14 % ====================================================================== 15 15 16 function retVal=fermi; 16 % get out input file from the command line 17 % invoke this script with the following command: 18 % matlab -nodisplay -r infile=\'driver1234.xml\',fermi 19 % the above command sets variable infile to the name 'driver1234.xml' 17 20 18 % We open the xml file in the main function and make lib global 19 global lib; 21 % infile = 'driver31619.xml' 22 23 % open our xml input file. 24 lib = rpLib(infile); 20 25 21 26 % retrieve user specified data out of the input file … … 41 46 rpLibPutString(lib,'output.curve(f12).yaxis.units','eV',0); 42 47 43 for j=1:200 44 rpUtilsProgress((j/200*100),'Iterating'); 45 putStr = sprintf('%12g %12g\n', f(j), E(j)); 46 % put the data into the xml file 47 rpLibPutString(lib,'output.curve(f12).component.xy',putStr,1); 48 end 48 % this is a slow and inefficient method of putting 49 % large amounts of data back in to the rappture library object 50 %for j=1:200 51 % rpUtilsProgress((j/200*100),'Iterating'); 52 % putStr = sprintf('%12g %12g\n', f(j), E(j)); 53 % % put the data into the xml file 54 % rpLibPutString(lib,'output.curve(f12).component.xy',putStr,1); 55 %end 56 57 % a better way is to take advantage of matlab's vector operations. 58 outData = [f;E]; 59 putStr = sprintf('%12g %12g\n', outData); 60 rpLibPutString(lib,'output.curve(f12).component.xy',putStr,0); 49 61 50 62 % signal the end of processing 51 63 rpLibResult(lib); 52 64 53 retVal = 0;65 quit; -
trunk/examples/app-fermi/matlab/uncompiled/fermi.m
r1222 r1260 46 46 rpLibPutString(lib,'output.curve(f12).yaxis.units','eV',0); 47 47 48 for j=1:200 49 rpUtilsProgress((j/200*100),'Iterating'); 50 putStr = sprintf('%12g %12g\n', f(j), E(j)); 51 % put the data into the xml file 52 rpLibPutString(lib,'output.curve(f12).component.xy',putStr,1); 53 end 48 % this is a slow and inefficient method of putting 49 % large amounts of data back in to the rappture library object 50 %for j=1:200 51 % rpUtilsProgress((j/200*100),'Iterating'); 52 % putStr = sprintf('%12g %12g\n', f(j), E(j)); 53 % % put the data into the xml file 54 % rpLibPutString(lib,'output.curve(f12).component.xy',putStr,1); 55 %end 56 57 % a better way is to take advantage of matlab's vector operations. 58 outData = [f;E]; 59 putStr = sprintf('%12g %12g\n', outData); 60 rpLibPutString(lib,'output.curve(f12).component.xy',putStr,0); 54 61 55 62 % signal the end of processing -
trunk/examples/app-fermi/octave/fermi.m
r665 r1260 41 41 rpLibPutString(lib,"output.curve(f12).yaxis.units","eV",0); 42 42 43 for j=1:200 44 rpUtilsProgress((j/200*100),'Iterating'); 45 putStr = sprintf('%12g %12g\n', f(j), E(j)); 46 % put the data into the xml file 47 rpLibPutString(lib,"output.curve(f12).component.xy",putStr,1); 48 end 43 % this is a slow and inefficient method of putting 44 % large amounts of data back in to the rappture library object 45 %for j=1:200 46 % rpUtilsProgress((j/200*100),'Iterating'); 47 % putStr = sprintf('%12g %12g\n', f(j), E(j)); 48 % % put the data into the xml file 49 % rpLibPutString(lib,"output.curve(f12).component.xy",putStr,1); 50 %end 51 52 % a better way is to take advantage of octave's vector operations. 53 outData = [f;E]; 54 putStr = sprintf('%12g %12g\n', outData); 55 rpLibPutString(lib,'output.curve(f12).component.xy',putStr,0); 49 56 50 57 % signal the end of processing
Note: See TracChangeset
for help on using the changeset viewer.