Mapping Toolbox | ![]() ![]() |
Convert pen-down delimited data to NaN
-delimited data
Syntax
Description
Pen-down delimited data is a matrix with a first column consisting of pen commands. At the beginning of each segment in the data, this first column has an entry corresponding to a pen-down command. Other entries indicate that the segment is continuing. NaN
-delimited data consists of columns of data, each segment of which ends in a NaN
in every data column. Since there is no pen command column, the NaN
-delimited format can represent the same data in one fewer columns; the remaining columns have more entries, one for each NaN
(i.e., for each segment).
dataout = nanclip(datain,pendowncmd) returns the pen-down delimited data in the matrix datain
as NaN
-delimited data in dataout
. When the first column of datain
equals pendowncmd
, a segment is started and a NaN
is inserted in all columns of dataout
. The default pendowncmd
is -1
.
Examples
datain = [-1 45 67; 0 23 54; 0 28 97; -1 47 89; 0 56 12]
datain =
-1 45 67 % Begin first segment
0 23 54
0 28 97
-1 47 89 % Begin second segment
0 56 12
dataout = nanclip(datain)
dataout =
45 67
23 54
28 97
NaN NaN % End first segment
47 89
56 12
NaN NaN % End second segment
See Also
spcread |
Read space-delimited data |
![]() | namem | nanm | ![]() |