Exclude elements from array or matrix

版本 1.0.0.0 (999 字节) 作者: Shoaibur Rahman
Exclude elements from array, and rows or columns from matrix
276.0 次下载
更新时间 2016/1/28

查看许可证

Y = exclude(X,indx,rc) takes an input X, which can be eithr an array or 2D matrix.
indx is the index of the row(s) or column(s) or elements to omit from the matrix or array.
rc is used to define whether the rows or columns to be excluded. For row exclusion use: 'row' and for column exlusion use: 'col' or 'column'. If nothing is defined then the default 'col' is set automatically. However, rc will automatically be set to 'col' or 'row' if X is a row or column vector, respectively.

Example 1
x = 1:10
y1 = exclude(x,[1 5])
y2 = exclude(x',5)

Example 2
X = magic(3)
y1 = exclude(X,2,'row')
y2 = exclude(X,2,'col')

引用格式

Shoaibur Rahman (2024). Exclude elements from array or matrix (https://www.mathworks.com/matlabcentral/fileexchange/55132-exclude-elements-from-array-or-matrix), MATLAB Central File Exchange. 检索来源 .

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

Community Treasure Hunt

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

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