vectorfill

版本 1.0.0.0 (3.4 KB) 作者: Mattias Karlsson
Takes the input vector VALUES, and changes the numbers at the specified indices that equal FILLVALUE
158.0 次下载
更新时间 2013/1/7

查看许可证

NEWVALUES = VECTORFILL(VALUES, FILLVALUE)

NEWVALUES = VECTORFILL(VALUES, FILLVALUE,DIRECTION)

NEWVALUES = VECTORFILL(VALUES, FILLVALUE,DIRECTION,INDICES)

DIRECTION can be either -1,0, or 1, and specifies whether to fill the numbers with the last non-FILLVALUE (-1) or the next non-FILLVALUE (1), or the nearest non-FILLVALUE (0 - default). The user can also specify which indices of VALUES operate on (default is all indices).

Example:
x = vectorfill([2 2 -1 3 3 3 3 -1 4 4 4], -1, 1)

x =
2 2 3 3 3 3 3 4 4 4 4

Written in c, so the operation is fast. Type "mex vectorfill.c" in matlab before use.

You might need a free compiler if it was not installed with your matlab:
http://www.mathworks.com/support/compilers/R2012b/win64.html

引用格式

Mattias Karlsson (2025). vectorfill (https://ww2.mathworks.cn/matlabcentral/fileexchange/39731-vectorfill), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R14
兼容任何版本
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

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

Start Hunting!

vectorfill/

版本 已发布 发行说明
1.0.0.0