vget#
Purpose#
Extracts a matrix or string from a data buffer constructed with vput().
Format#
- { x, dbufnew } = vget(dbuf, name)#
- Parameters:
dbuf (Nx1 vector) – a data buffer containing various strings and matrices.
name (string) – the name of the string or matrix to extract from dbuf.
- Returns:
x (LxM matrix or string) – the item extracted from dbuf.
dbufnew (Kx1 vector) – the remainder of dbuf after x has been extracted.
Examples#
// Build a data buffer and extract an item
dbuf = vput(0, rndn(2, 3), "X");
dbuf = vput(dbuf, "hello", "msg");
// Extract "X", removing it from the buffer
{ x, dbuf } = vget(dbuf, "X");
print x;
Source#
pack.src