uniquify
Keine Lizenz
Some Matlab functions (e.g., interpolation) require their inputs to be a unique set of values. UNIQUIFY ensures that a given data vector is unique by adding very small numbers to duplicate entries in the input.
UNIQUIFY does NOT sort the values, contrary to Matlab's unique() function - it just slightly modifies any duplicate values. The data remains in its original order.
Example:
vals = uniquify([1,1,1]) -1; => [0, 2.22e-16, 4.44e-16]
Algorithm:
loop over all duplicate entries, adding eps*2^iter in each iteration until the entire data vector is unique.
See also:
unique, interp1, consolidate (on the File Exchange)
Zitieren als
Yair Altman (2025). uniquify (https://de.mathworks.com/matlabcentral/fileexchange/16098-uniquify), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Plattform-Kompatibilität
Windows macOS LinuxKategorien
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0.0 | Improved performance & accuracy; fixed runaway exponential deltas; fixed single/double support; added comments |
