Assigns the contours for a rectilinear grid to a script variable.
Syntax |
Description |
---|---|
x = getcontour(<name_of_rectilinear_grid>, "<attribute_name>", level(s)); |
Assigns the contours of the rectilinear grid with "attribute_name" to the variable "x". "level(s)" is a matrix with the level numbers. The returned variable "x" is a cell of structs with the fields "level" and "polygons". |
Example
The following script command adds a rectangle object with mesh override in FDTD and gets its contours to the variable "contour_x".
addfdtd;
addindex;
addrect;
addmesh;
setnamed("mesh", "dx", 1e-10);
setnamed("mesh", "dy", 1e-10);
setnamed("mesh", "dz", 1e-10);
setnamed("rectangle", "name", "cube");
setnamed("cube", "x span", 0.36e-6);
setnamed("cube", "y span", 0.36e-6);
setnamed("cube", "z span", 0.36e-6);
index = getresult("monitor", "index");
level = [1.2, 1.4];
contour_x = getcontour(index, "index_x", level);
>?contour_x;
Cell array with 2 elements
>?contour_x{1}?
Struct with fields:
level
polygons
>?contour_x{1}.level;
Result:
1.2
See Also