insertNaN

版本 1.0.0.0 (1.8 KB) 作者: Chris Miller
Used to insert NaN values into a vector or matrix given a threshold condition.
328.0 次下载
更新时间 2011/9/15

查看许可证

usage: output=insertNaN(data,threshold);
INPUTS: data - vector/matrix data which will be checked for gaps
threshold - threshold value to distinguish where NaN's are placed in the data
OUTPUTS: output - input data, with NaN values inserted where differences exceeded the requested threshold

Example 1:
output=insertNaN([11:13 15:17 19:21 25:27],1);
returns:
output = [11 12 13 NaN 15 16 17 NaN 19 20 21 NaN 25 26 27]

Example 2:
output=insertNaN([[1:2 5:7 9:10].',[1:7].',[11:17].'],1);
returns:
output =
1 1 11
2 2 12
NaN NaN NaN
5 3 13
6 4 14
7 5 15
NaN NaN NaN
9 6 16
10 7 17

Useful to denote "pen up" breakpoints when generating plots or maps where gaps occur in timeseries, position data, etc.

引用格式

Chris Miller (2024). insertNaN (https://www.mathworks.com/matlabcentral/fileexchange/32897-insertnan), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2011a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 NaNs 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0