Unique function doesn't work in Simulink
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a 624x2 matrix that needs to have repeated ordered pairs removed. The first column represents x values and the 2nd column represents y values. There are some repeating pairs and I need to remove them in the matlab function block in Simulink but when I execute the "unique" function in Simulink I get an error saying: An error occurred while running the simulation and the simulation was terminated Caused by: The second operand is not sorted in ascending order. Use SORT first.
How do I get around this error? If I use "sort" then won't I lose my ordered pairs because the two columns will be sorted independently? My highly simplified code is below.
SRM = some 624x2 matrix SRM = unique(SRM(:,:), 'rows');
2 Kommentare
OCDER
am 22 Sep. 2017
That's odd, since unique(SRM, 'rows') should remove duplicate rows and sort for you.
Antworten (1)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!