Different behaviour in indexing between table and digraph node table

2 ビュー (過去 30 日間)
Peter Valent
Peter Valent 2022 年 5 月 9 日
回答済み: Christine Tobler 2022 年 5 月 10 日
I have a table with one column of type cell holding logical vectors of the same size. I want to be able to combine these logical vectors from multiple lines into a single variable (logical matrix).
Example for an ordinary table - this works:
% Create table
tb = table;
tb.a = cell(2,1);
tb.a(:) = {true(5,1)};
% Index table
b = [tb.a{[1,2]}]
Example for a digraph table - this does not work:
% Create digraph with node table
D = digraph(1,2);
D.Nodes.a = cell(2,1);
D.Nodes.a(:) = {true(5,1)};
% Index digraph table
b = [D.Nodes.a{[1,2]}]
This is a workaround which I would like to avoid:
% Index digraph table
tmp = D.Nodes.a([1,2]);
b = [tmp{:}]
Why the behaviour of the ordinary table and the table in a digraph object is different?

採用された回答

Christine Tobler
Christine Tobler 2022 年 5 月 10 日
This is a bug in digraph, thank you for reporting it! I have passed it along and it will be fixed in a future release.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by