Getting access inside a Structure that I know name of the structure

2 ビュー (過去 30 日間)
mohammad
mohammad 2012 年 7 月 7 日
There are some Structures on Workspace. I know the names of these structures. But these names are string. how could I get access inside that Structure from a .m file? For example name of the first structure is name='AB'. if I write "name" in a .m file, it gives us 'AB' !!! But i need to access that structure.
In other word, is there any command for structure like "eval" command for matrix?

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 7 月 7 日
A structure is a matrix.
We recommend that you reconsider what you are doing. You should be able to avoid eval. Referring to entire variables by name usually leads to security problems, program instability, unreadable programs, inefficiencies, and bugs that are quite difficult to find.

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by