point_pack function packs data to PSG Parameter in MATLAB.
Syntax
[this_struct] = tbpsg_parameter_pack(name, data)
[this_struct] = tbpsg_parameter_pack(name, data, options)
Description
[this_struct] = tbpsg_parameter_pack(name, data)returns (packs) structure this_struct with PSG Parameter in Toolbox format (see PSG Parameter in Toolbox).
[this_struct] = tbpsg_parameter_pack(name, data, options) packs parameter with additional options.
Input Arguments
name |
string with name of point; |
data |
value of parameter, or string, or name of MATLAB variable with parameter; |
options |
structure with field overwrite. If the input data of tbpsg_parameter_pack is MATLAB expression (not MATLAB variable), then the new variable with name parameter_name_data (name = input of tbpsg_parameter_pack) will be created. If variable parameter_name_data already exist and options.overwrite = 1 (default), then this variable will be overwritten. Otherwise the new variable with name parameter_name_data_i (i = 1,2,...) will be created. |
Remarks
• | name of parameter 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 parameter alpha = 0.95 to structure "toolboxstruc_arr" write:
toolboxstruc_arr = tbpsg_parameter_pack('alpha', 0.95);
Output:
>> toolboxstruc_arr
toolboxstruc_arr =
type: 'parameter'
data: [1x1 struct]
string: [1x1 struct]
>> toolboxstruc_arr.data
ans =
name: 'alpha'
data: 0.950000000000000
>> toolboxstruc_arr.string
ans =
name: 'alpha'
data: 'parameter_alpha_data'
Remarks
• | variable parameter_alpha_data was created automatically. |
See also
PSG Parameter in Toolbox, tbpsg_matrix_pack, tbpsg_pmatrix_pack,tbpsg_vector_pack, tbpsg_point_pack