copytable

Copy a table associated with a table-handle and optionally resize it with or without interpolation.


Synopsis

table = copytable(table_handle[, newsize[, interp_type]])

Parameters inside the [brackets] are optional.


Description

copytable makes a copy of a table associated with table_handle. Using the optional newsize argument, the copied table may be larger or smaller than the original table. The second optional argument, interp_type determines if the resized table uses interpolation or simply truncates the values to determine the values in the new table.


Arguments


RETURN VALUE

Returns a table-handle for the new, copied and (possibly) resized table


Examples

   table = maketable("wave", 4000, 1.0, 0.2, 0.1)
   newtable = copytable(table, 1000, "interp")

newtable will be associated with a new table that will contain the same waveform defined in the first maketable, except that it will only fill 1000 elements instead of 4000. The new values will be determined by linear interpolation if they don’t align with the values taken from the original 4000-point table.


See Also

maketable, modtable, makefilter, makeconverter, plottable, dumptable, tablelen, mul, div, sub, add