pvPacksi

Purpose

Packs symmetric matrix into a PV instance with matrix name and index.

Format

p1 = pvPacksi(p1, x, nm, i)
Parameters:
  • p1 (struct) – an instance of structure of type PV
  • x (MxM symmetric matrix) – data
  • nm (string) – matrix name.
  • i (scalar) – index of matrix in lookup table.
Returns:

p1 (struct) – instance of PV struct.

Examples

// Declare structure
struct PV p1;
p1 = pvCreate;

// X matrix to be packed
x = { 1 2, 2 1 };

//  Back x matrix into PV structure
p1 = pvPacksi(p1, x, "A", 1);

// Unpack identity matrix
p1 = pvPacksi(p1, eye(2), "I", 2);

These matrices can be extracted using the pvUnpack() command.

print
pvUnpack(p1, 1);
1.000 2.000
2.000 1.000
print
pvUnpack(p1, 2);
1.000 0.000
0.000 1.000

Remarks

pvPacksi() does not support the packing of arrays.

See also

Functions pvPacks(), pvUnpack()