Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Octave で問題が発生しました。テキスト内の 2 つの文字のすべての異なる (!) ペアを検索したい (スペースなし、文字のみ)
例: my text = "abcdabcd"
ab bc cd da のような配列 (またはベクトル?) を見つけたい
これを可能な限り簡単に行うにはどうすればよいですか?
ご協力いただきありがとうございます
unique()関数を使用してこれを行うことができます。唯一のトリックは、1 文字ずらして 2 行を使用して実行できる 2 文字のリストを作成することです。
unique()
str = "abcdabcd"; str(2,:) = shift (str, -1); str(:,end) = []; # remove last column unique (str', "rows")