Please enable JavaScript to view this site.

Knowledge Base

Navigation: Scripting Language > Manipulating variables

Struct

We've made some changes. Use 'Ctrl-F5' to clear your browser cache.
Scroll Prev Top Next More

Adds a structure array. Any data type (such as matrix, string, dataset) can be added to structure arrays.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

a = struct;

Creates an structure array.

a.a = "string";

Adds a string field to the structure array.

a.b = matrix(5,5);

Adds a field of matrix of 5x5 to the structure array.

 

 

Examples

 

An example of a structure array is created and a few different data types are added to the array.

C = struct;

C.a = [1, 4, 9]; 

C.b = "a string";

C.d = matrix(5,5); 

C.e = getresult("monitor","T");

 

?C;

Struct with fields:

a

b

d

e

?C.a;

result: 

1 4 9 

?C.a(2);

result: 

4

?C.b;

a string

?C.d;

result: 

0 0 0 0 0 

0 0 0 0 0 

0 0 0 0 0 

0 0 0 0 0 

0 0 0 0 0 

?C.e;

T vs lambda/f

 

See Also

Datasets, matrixdataset, rectilineardataset, cell

Copyright Lumerical Inc. | Privacy | Site Map