이 제출물을 팔로우합니다
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다
This Matlab function provides a way to find:
- unique 2-element rows, when rows have switched elements ("u"), i.e., for example, both rows "1 5" and "5 1" are present in the input matrix,
- rows with switched elements ("s"), and
- indices of rows with switched elements ("is").
Note: this function is designed ONLY for 2-column matrices as input.
More details here: https://ch.mathworks.com/matlabcentral/answers/1737050-a-compact-way-to-find-1-unique-rows-when-rows-have-switched-elements-2-rows-with-switched-ele
% Example of usage:
clear all
clc
% input (here, the row "1 2" is repeated as row "2 1" and the the row "1 5" is repeated as row "5 1")
a = [1 2
4 5
5 1
2 1
1 2
5 2
5 1
1 5
2 9
5 1]
% output
[u,s,is] = unique_switch(a)
% command window
>> u =
1 2
1 5
2 9
4 5
5 2
>> s =
2 1
5 1
>> is{:}
ans =
1
4
5
ans =
3
7
8
10
인용 양식
Sim (2026). Unique function for rows with switched elements (https://kr.mathworks.com/matlabcentral/fileexchange/112920-unique-function-for-rows-with-switched-elements), MATLAB Central File Exchange. 검색 날짜: .
