vector_pack function packs data to PSG Vector in MATLAB.

Syntax

[this_struct] = tbpsg_vector_pack(name, data)

[this_struct] = tbpsg_vector_pack(name, data, options)

 

Description

[this_struct] = tbpsg_vector_pack(name, data) returns (packs) structure this_struct with PSG Vector in Toolbox format (see PSG Vector in Toolbox).

[this_struct] = tbpsg_vector_pack(name, data, options) packs vector with additional options.

 

Input Arguments

name

name of vector;

data

vector data;

options

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

 

Remarks

name of  vector 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 vector [0.1 1] to structure "toolboxstruc_arr" write:

toolboxstruc_arr = tbpsg_vector_pack('vector_example', [0.1 1]);

 

Output:

>> toolboxstruc_arr

 

toolboxstruc_arr =

 

     type: 'vector'

     data: [1x1 struct]

   string: [1x1 struct]

 

>> toolboxstruc_arr.data

 

ans =

 

   name: 'example'

   data: [0.100000000000000 1]

 

>> toolboxstruc_arr.string

 

ans =

 

   name: 'example'

   data: 'vector_example_data'

 

Remarks

variable vector_example_data was created automatically.

 

See also

PSG Vector in Toolbox, tbpsg_matrix_pack, tbpsg_pmatrix_pack, tbpsg_point_pack, tbpsg_parameter_pack