Changeset 135 for trunk/examples/app-fermi
- Timestamp:
- Nov 10, 2005, 7:45:00 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/app-fermi/matlab/fermi_rp.m
r122 r135 1 1 % ---------------------------------------------------------------------- 2 % EXAMPLE: Fermi-Dirac function in Matlab.2 % EXAMPLE: Fermi-Dirac function in Octave. 3 3 % 4 % This script represents a legacy application that will be left5 % intact, but wrapped with a Rapptureinterface.4 % This script represents a newly written application with rappture 5 % bindings and interface. 6 6 % 7 7 % ====================================================================== … … 21 21 % retrieve user specified data out of the input file 22 22 % convert values to correct units. 23 Ef = rp GetString(lib,"input.number(Ef).current");24 [Ef,err] = rp ConvertDbl(Ef,"eV");25 T = rp GetString(lib,"input.number(temperature).current");26 [T,err] = rp ConvertDbl(T,"K");23 Ef = rpLibGetString(lib,"input.number(Ef).current"); 24 [Ef,err] = rpUnitsConvertDbl(Ef,"eV"); 25 T = rpLibGetString(lib,"input.number(temperature).current"); 26 [T,err] = rpUnitsConvertDbl(T,"K"); 27 27 28 28 % do fermi calculations (science)... … … 36 36 % prepare out output section 37 37 % label graphs 38 rp PutString(lib,"output.curve(f12).about.label","Fermi-Dirac Factor",0);39 rp PutString(lib,"output.curve(f12).xaxis.label","Fermi-Dirac Factor",0);40 rp PutString(lib,"output.curve(f12).yaxis.label","Energy",0);41 rp PutString(lib,"output.curve(f12).yaxis.units","eV",0);38 rpLibPutString(lib,"output.curve(f12).about.label","Fermi-Dirac Factor",0); 39 rpLibPutString(lib,"output.curve(f12).xaxis.label","Fermi-Dirac Factor",0); 40 rpLibPutString(lib,"output.curve(f12).yaxis.label","Energy",0); 41 rpLibPutString(lib,"output.curve(f12).yaxis.units","eV",0); 42 42 43 43 for j=1:200 44 44 putStr = sprintf('%12g %12g\n', f(j), E(j)); 45 45 % put the data into the xml file 46 rp PutString(lib,"output.curve(f12).component.xy",putStr,1);46 rpLibPutString(lib,"output.curve(f12).component.xy",putStr,1); 47 47 end 48 48 49 49 % signal the end of processing 50 rp Result(lib);50 rpLibResult(lib);
Note: See TracChangeset
for help on using the changeset viewer.