Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.1 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Elementary Functions > setoperations > unique

unique

ベクトルまたは行列のユニークなな要素を展開

呼び出し手順

[N [,k]]=unique(M)
[N [,k]]=unique(M ,orient)

パラメータ

M

数値または文字列のベクトルまたは行列

orient

フラグで以下の値のどれかとなる : 1 または "r", 2 または "c"

N

数値または文字列のベクトルまたは行列

k

整数のベクトル

説明

unique(M)Mのユニークなエントリを昇順に したものを保持するベクトルを返します.

unique(M,"r") または unique(M,1)は, Mのユニークな行を 辞書式の昇順にして返します.

unique(M,"c") または unique(M,2)Mのユニークな列を 辞書式の昇順にして返します.

出力引数kが指定された場合, ユニークなエントリが最初に現れた最初の位置が 代入されます.

M=round(2*rand(20,1));

unique(M)
[N,k]=unique(M)

unique(string(M))
[N,k]=unique(string(M))

A = [0,0,1,1;
     0,1,1,1;
     2,0,1,1;
     0,2,2,2;
     2,0,1,1;
     0,0,1,1];
T='x'+string(A);

//ユニークな行

[m,k]=unique(A,'r')
unique(T,'r')

//ユニークな列
[m,k]=unique(T,'c')
unique(A,'c')

参照

  • union — ベクトルの和集合要素を展開
  • intersect — 2つのベクトルで共通の値のベクトルを返す
  • gsort — クイックソートアルゴリズムによるソート
  • lex_sort — 行列の行の辞書式ソート
Report an issue
<< union setoperations signalprocessing >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Apr 02 17:37:31 CEST 2013