Unique Columns Certain Rows

Get the "Unique Columns" of a double matrix, with regard to certain rows and tolerance
55 Downloads
Updated 2 Feb 2016

View License

Unique Columns Certain Rows is a (very) small function set, which given a double matrix A forms a second matrix B containing the columns of A which have the same value (below a tolerance) in a set of rows specified by a logical vector. Additionally, it outputs a vector which has the "category" to which each column of A belongs.
PS: Current version doesn't guarantee anything about the elements in the "non determinant" rows of A. B will contain those corresponding to the last tested column.

Graphical example:

A= [ 1 1 2 3
2 1 1 1
4 4 4 3
5 6 6 6 ]

whichRows= [ true
false
true
false ]
tol=1

[B,indexVector]=uniqueColumnsCertainRows(A,whichRows,tol) =>

B= [ 1 2 3
1 1 1
4 4 3
6 6 6 ]

indexVector=[1,1,2,3]

Cite As

Claudio Delpino (2024). Unique Columns Certain Rows (https://www.mathworks.com/matlabcentral/fileexchange/55217-unique-columns-certain-rows), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Shifting and Sorting Matrices in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0