point_pack function packs data to PSG Point in MATLAB.

Syntax

[this_struct] = tbpsg_point_pack(name, data)

[this_struct] = tbpsg_point_pack(name, data, vars)

[this_struct] = tbpsg_point_pack(name, data, vars, options)

 

Description

[this_struct] = tbpsg_point_pack(name, data)returns (packs) structure this_struct with PSG Point in Toolbox format (see PSG Point in Toolbox). Names of variables (vars), by default are 'x1', …, 'x#n', where n is the number of columns in point data.

[this_struct] = tbpsg_point_pack(name, data, vars) packs point with names of variables vars.

[this_struct] = tbpsg_point_pack(name, data, vars, options) packs point with additional options.

 

Input Arguments

name

name of point;

data

point data;

vars

names of headers of object data;

options

structure with field overwrite. If the input (data, or vars) of tbpsg_point_pack  is  MATLAB expression (not MATLAB variable), then the new variable with name point_name_keyword (name = input of tbpsg_point_pack, keyword = data, or vars) will be created.  If variable point_name_keyword already exist and options.overwrite = 1 (default), then this variable will be overwritten. Otherwise the new variable with name point_name_keyword_i (i = 1,2,...) will be created.

 

Remarks

name of  point should not exceed 128 symbols, it is not case sensitive and includes only alphabetic characters, numbers, and underscore sign, “_”.

 

Output Arguments

this_struct

pointer to the PSG data structure.

 

Example

To pack point [0.1 1] to structure "toolboxstruc_arr" write:

toolboxstruc_arr = tbpsg_point_pack('point_example', [0.1 1], {'x1', 'x2'});

 

Output:

>> toolboxstruc_arr

 

toolboxstruc_arr =

 

     type: 'point'

     data: [1x1 struct]

   string: [1x1 struct]

 

>> toolboxstruc_arr.data

 

ans =

 

   name: 'example'

   data: [0.100000000000000 1]

   vars: 'x1        x2'

 

>> toolboxstruc_arr.string

 

ans =

 

   name: 'example'

   data: 'point_example_data'

   vars: 'point_example_vars'

 

Remarks

variables point_example_data and point_example_vars were created automatically.

 

See also

PSG Point in Toolbox, tbpsg_matrix_pack, tbpsg_pmatrix_pack,tbpsg_vector_pack, tbpsg_parameter_pack