|
2D GRIDName:
3D GRID (LET) 4D GRID (LET)
For example, given X1 = 0, 0.5, 1.0 and X2 = 0, 0.2, 0.4 0.6, 0.8, 1.0, the gridded output (saved in Y1 and Y2) would be
This basic logic can be extended to the case of three or four input variables. Although the gridded values can also be generated with a set of SEQUENCE commands, these commands are provided as a convenience.
<SUBSET/EXCEPT/FOR qualification> where <x1> is a variable containing the values for the first variable to be gridded; <x2> is a variable containing the values for the second variable to be gridded; <y1> is a variable where the gridded values for the first variable are saved; <y2> is a variable where the gridded values for the second variable are saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
<SUBSET/EXCEPT/FOR qualification> where <x1> is a variable containing the values for the first variable to be gridded; <x2> is a variable containing the values for the second variable to be gridded; <x3> is a variable containing the values for the third variable to be gridded; <y1> is a variable where the gridded values for the first variable are saved; <y2> is a variable where the gridded values for the second variable are saved; <y3> is a variable where the gridded values for the third variable are saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
<SUBSET/EXCEPT/FOR qualification> where <x1> is a variable containing the values for the first variable to be gridded; <x2> is a variable containing the values for the second variable to be gridded; <x3> is a variable containing the values for the third variable to be gridded; <x4> is a variable containing the values for the fourth variable to be gridded; <y1> is a variable where the gridded values for the first variable are saved; <y2> is a variable where the gridded values for the second variable are saved; <y3> is a variable where the gridded values for the third variable are saved; <y4> is a variable where the gridded values for the fourth variable are saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional.
LET Y1 Y2 Y3 = 3D GRID X1 X2 X3
. Step 1: Define input values . let x1 = sequence 0 0.1 10 let x2 = sequence 0 0.1 10 . . Step 2: Generate the gridded sequence . let y1 y2 = 2d grid x1 x2 set write decimals 1 print y1 y2 ------------------------------ Y1 Y2 ------------------------------ 0.0 0.0 0.0 0.1 0.0 0.2 0.0 0.3 0.0 0.4 0.0 0.5 0.0 0.6 0.0 0.7 0.0 0.8 0.0 0.9 0.0 1.0 0.1 0.0 0.1 0.1 0.1 0.2 0.1 0.3 0.1 0.4 0.1 0.5 0.1 0.6 0.1 0.7 0.1 0.8 0.1 0.9 0.1 1.0 0.2 0.0 0.2 0.1 0.2 0.2 0.2 0.3 0.2 0.4 0.2 0.5 0.2 0.6 0.2 0.7 0.2 0.8 0.2 0.9 0.2 1.0 0.3 0.0 0.3 0.1 0.3 0.2 0.3 0.3 0.3 0.4 0.3 0.5 0.3 0.6 0.3 0.7 0.3 0.8 0.3 0.9 0.3 1.0 0.4 0.0 0.4 0.1 0.4 0.2 0.4 0.3 0.4 0.4 0.4 0.5 0.4 0.6 0.4 0.7 0.4 0.8 0.4 0.9 0.4 1.0 0.5 0.0 0.5 0.1 0.5 0.2 0.5 0.3 0.5 0.4 0.5 0.5 0.5 0.6 0.5 0.7 0.5 0.8 0.5 0.9 0.5 1.0 0.6 0.0 0.6 0.1 0.6 0.2 0.6 0.3 0.6 0.4 0.6 0.5 0.6 0.6 0.6 0.7 0.6 0.8 0.6 0.9 0.6 1.0 0.7 0.0 0.7 0.1 0.7 0.2 0.7 0.3 0.7 0.4 0.7 0.5 0.7 0.6 0.7 0.7 0.7 0.8 0.7 0.9 0.7 1.0 0.8 0.0 0.8 0.1 0.8 0.2 0.8 0.3 0.8 0.4 0.8 0.5 0.8 0.6 0.8 0.7 0.8 0.8 0.8 0.9 0.8 1.0 0.9 0.0 0.9 0.1 0.9 0.2 0.9 0.3 0.9 0.4 0.9 0.5 0.9 0.6 0.9 0.7 0.9 0.8 0.9 0.9 0.9 1.0 1.0 0.0 1.0 0.1 1.0 0.2 1.0 0.3 1.0 0.4 1.0 0.5 1.0 0.6 1.0 0.7 1.0 0.8 1.0 0.9 1.0 1.0Program 2: . Step 1: Define input values . let x1 = sequence 0 0.1 10 let x2 = sequence 0 0.1 10 let x3 = sequence 0 0.1 10 . . Step 2: Test the command . let y1 y2 y3 = 3d grid x1 x2 x3 set write decimals 1 print y1 y2 y3 for i = 1 1 40 --------------------------------------------- Y1 Y2 Y3 --------------------------------------------- 0.0 0.0 0.0 0.0 0.0 0.1 0.0 0.0 0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