home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
spredsht
/
prof2d.arc
/
EXAMPLE1.PR2
< prev
next >
Wrap
Text File
|
1989-02-26
|
3KB
|
107 lines
: Prof2d, The 2D Scientific Spreadsheet
: by Gertjan L. Ouwerling, Electrical Materials Lab, Delft University
: -------------------------------------------------------------------
: Example 1: Reading, viewing and writing data
:
: Execute this example by typing: prof2d example1.pr2 <enter>
:
: NOTE: some steps may be slow without a co-processor!
: Graphical pictures are terminated by giving <enter>
:
: -------------------------------------------------------------------
:
: Prof2d data types are declared.
: Data is read from a file in matrix form (command mget);
: the alternative is 2D data in list form (x y z1 z2 z3 ... lines)
: with the command get.
row xaxis x1 $ column yaxis y1 $ field data z1 $
mget example1.mat xaxis yaxis data
pause
:
: A first look is taken at the data using the contour plot preview
: command cview.
: Give <enter> to exit the graphical mode!
:
pause
cview xaxis yaxis data
:
: This plot does not provide enough information. We will set some
: contour values by hand and take a second look.
: Again, give <enter> to leave the picture.
:
setcont 0.0001 0.0005 0.001 0.005 0.01 0.05 0.1 0.5 1 $
pause
cview xaxis yaxis data
:
: We decide a plot of the quantity in logaritmic mode would be
: better. This is done by taking the log of the data values into
: a new field data is declared for this purpose.
: The chosen contour values are reset before invoking cview.
:
field ldata $
ldata = log(abs(data)+1e-06)
setcont $
pause
cview xaxis yaxis ldata
:
: To get a different view, the two axes and the field are copied to
: new variables and transposed. Note: the rows and columns are also
: interchanged by the transpose command!
:
x1=xaxis
y1=yaxis
z1=ldata
transpose x1 y1 z1
show rows
pause
cview y1 x1 z1
:
: We will now write the data and ldata fields to a file in listed
: form using the put command (Note: not mput) that creates list
: format files. You may practise yourself a little by trying to
: read this file again (using get) and making some pictures.
:
: Precision is set to 3 number behind the floating dot.
:
: Note the dollar sign $ to indicate end of field names.
:
putprec=3
put example1.lis xaxis yaxis data ldata $
:
: Give quit <enter> to exit Prof2d
: or continue playing around a little!
:
: Some interesting Prof2d commands not demonstrated in this example
: -----------------------------------------------------------------
:
: help - read information from the help file
: give help help <enter> for an overview of all commands
:
: view/plot - make 1D cross sections through 2D data
: remx/remy - remove rows/columsn from the data base
: redx/redy - reduce the row/column data density
: mirror - mirror a row or column with a field
: inte2d - integrate by 2D trapezium rule (with bilinear interpolation)
:
: