how can I create a new structure based on a existing one?
Show older comments
Dear All,
I have a structure A as below
A
a1[1*1]
a21[1*1] a22[1*1]
a31[1*1] a32[1*1] a33[1*1] a34[1*1]
I want to get a new A as following
A new
a1[1*1] same as before
a21[1*1] a21[1*1] a22[1*1] a22[1*1]
a31[1*1] a31[1*1] a32[1*1] a32[1*1] a33[1*1] a33[1*1] a34[1*1] a34[1*1]
eg a21 is just refering the element in the structure and 1*1 is the dimension for each element, here it is a number.
For further usage I have to store it in this structure. Thanks a lot in advance
3 Comments
Azzi Abdelmalek
on 8 Feb 2013
what is a1[1*1] ?
Jan
on 8 Feb 2013
Please use valid Matlab syntax to describe your data. It is inefficient if we have to guess the details. Thanks.
Skirt Zhang
on 8 Feb 2013
Edited: Skirt Zhang
on 8 Feb 2013
Answers (1)
Thorsten
on 8 Feb 2013
0 votes
If you want to build a structure A of class struct (such that >> class(A) yields 'ans = struct') you cannot do it because the fields of the struct a1, a22 etc have to have different names. Or is your 'structure A' a matrix?
Categories
Find more on Structures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!