creation of a structure of cells

1 回表示 (過去 30 日間)
Giri
Giri 2018 年 4 月 9 日
編集済み: Giri 2018 年 4 月 9 日
Hi,
I have a set of data as can be seen from the attached snapshot. As can be observed, it is a set of repetitive data. I am trying to write a code such that the code would create a main structure "RoadXML" with all the subsequent text in the cell as structure elements.
For eg: " RoadXML.Network.SubNetworks.SubNetwork.RoadNetwork.Grounds.Ground" should produce a structure RoadXML which has a struct element "Networks" which inturn is a structure. Likewise " Networks" should have " Subnetworks" as an element which is a structure and so on... Furthurmore, the rest of the data should append itself to the main structure under its respective fields. Hence in the end only one structure would remain with all the data in the excel sheet as its structure elements.
Now the problem is that, when repetitive sets of elements are present in the excel sheet as can be seen from the screenshot, only the last set of data remains thus overwriting the data that has been already stored. That is to say (with reference to the attached screenshot) data from rows 30 to 34 over writes all the data from rows 15 to 29 that has been alreaady stored. So instead of overwriting the data; the code should create a cell array with each set of data. For example, one set of data (wrt the screenshot) is from row 15 to 19. So that would mean there are 4 sets of data now. So instead of overwriting the data, i require the code to create a 1x4 cell array. To be more clear, from the screenshot, the output should be one 1x4 cell array "Ground". Each element of this cell array would be a structure ("Attributes"). In turn "Attributes" should also be a structure which has granulosity, grip, name and type as structure members
Requesting assistance for getting over this issue that i have.
Thanks in advance,
Giri

回答 (0 件)

カテゴリ

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