Not able to store an Array field from a Structure to another variable

1 回表示 (過去 30 日間)
Vamshik Mohan
Vamshik Mohan 2023 年 1 月 17 日
編集済み: Stephen23 2023 年 1 月 17 日
So I have this structure in which one field stores position data which is another array of 5 data points for 20 entities. When I call the structure as StructName.FieldName, it returns all the members (5x20) which is good but when I assign this to another variable, it only accepts the first array and the other 19 are ignored. As shown below, the structure with name F1 has a field with Position arrays as shown.
F1.Position %This returns the entire column properly
Variable=F1.Position %Only the first entry gets stored
Even F1.Position(2) or any other number gives an error saying
"Intermediate dot '.' indexing produced a comma-separated list with 20 values, but it must produce a single value when followed by subsequent indexing operations."
Essentially I want to store that entire column in a separate variable and would love a clean and MATLAB worthy way to achieve it.
Thanks in advance.....

回答 (1 件)

Stephen23
Stephen23 2023 年 1 月 17 日
編集済み: Stephen23 2023 年 1 月 17 日

カテゴリ

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

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by