Access data in cell and save as vector with corresponding variable name
古いコメントを表示
hey there,
i am creating a cell with tables in it when i read a mf4 file. (see picture 1)

Thats the structure of each table (picture 2):

I can access each variable easily with the brackets and save them with the wanted name.
However I want to automate it.
For instance search for d2s and get the values out of the table and save it in a vector in double format with the vector named after the variable.
t does not need to be extracted.
Thanks in advance! HMU if you need more!
4 件のコメント
Jan
2022 年 9 月 27 日
As usual the recommendation is: don't do this! Creating variables dynamically is a shot in your knee. See TUTORIAL: Why and how to avoid Eval
You can create a struct instead, which contains the wanted vectors.
Jan
2022 年 9 月 29 日
Did you read the link? You find the "bad solution" there also as deprecated method, because it causes more trouzbles as it solves. But of course, if you really want to apply this, do it.
Dennis
2022 年 9 月 29 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!