predecessors
先行ノード
説明
例
先行ノード
有向グラフを作成してプロットし、ノード 'e'
の先行ノードを求めます。
s = [1 1 1 2 2 3 3 7 8]; t = [2 3 4 5 6 7 8 5 5]; names = {'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h'}; G = digraph(s,t,[],names); plot(G)
preIDs = predecessors(G,'e')
preIDs = 3x1 cell
{'b'}
{'g'}
{'h'}
入力引数
出力引数
preIDs
— 先行ノード ID
ノード インデックス | ノード名
先行ノード ID。ノード インデックスまたはノード名として返されます。
nodeID
が数値ノード インデックスの場合、preIDs
は数値ノード インデックスを含みます。nodeID
がノード名の場合、preIDs
はノード名を含みます。
ヒント
同じ 2 つのノード間に複数のエッジがある多重グラフでは、一部の先行ノードからの入方向エッジが複数存在する可能性があるため、
inedges
の出力がpredecessors
の出力より長くなる場合があります。
拡張機能
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
使用上の注意事項および制限事項:
ノード識別子
nodeID
は、入力グラフG
の数値のノード インデックスでなければなりません。ノード名はサポートされません。
バージョン履歴
R2015b で導入
参考
neighbors
| successors
| digraph
| indegree
| inedges
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)