Improved dictionary variable view

Is there any way view a dictionary and click on key / values inside the dictionary to view the tables/objects inside, similar to what happens for a struct?
Currently when looking at a dictionary with the variable viewer, it looks like the following:

回答 (1 件)

Harimurali
Harimurali 2024 年 5 月 7 日

0 投票

Hi Henry,
As of MATLAB R2024a, it is not possible to directly expand and view the contents of objects that are the keys or values in a dictionary variable by double-clicking on the dictionary variable in the MATLAB workspace browser.
This can be achieved using the "entries" function in MATLAB, which returns the key-value pairs of the dictionary as a table or structure. Follow the below mentioned steps to view the contents of the objects that are keys or values in a dictionary variable:
  • Save the result of the "entries" function to a variable in MATLAB.
comp_defs_table = entries(comp_defs);
  • Double-click on "comp_defs_table" variable from the MATLAB workspace browser to open and view the table.
  • From the table, double-click on the object that is a key or a value to view the contents.
Refer to the following documentation for information about the "entries" function: https://www.mathworks.com/help/releases/R2024a/matlab/ref/dictionary.entries.html

カテゴリ

ヘルプ センター および File ExchangeWorkspace Variables and MAT Files についてさらに検索

タグ

質問済み:

2024 年 4 月 30 日

回答済み:

2024 年 5 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by