vread#

Purpose#

Reads a string or matrix from a data buffer constructed with vput().

Format#

x = vread(dbuf, xname)#
Parameters:
  • dbuf (Nx1 vector) – a data buffer containing various strings and matrices.

  • xname (string) – the name of the matrix or string to read from dbuf.

Returns:

x (LxM matrix or string) – the item read from dbuf.

Remarks#

vread(), unlike vget(), does not change the contents of dbuf. Reading x from dbuf does not remove it from dbuf.

Examples#

// Read an item from a data buffer without removing it
dbuf = vput(0, rndn(2, 2), "mymat");
dbuf = vput(dbuf, "test", "mystr");

x = vread(dbuf, "mymat");
print x;
// dbuf still contains "mymat" and "mystr"

Source#

vpack.src

See also

Functions vget(), vlist(), vput()