I have a struct A with many fields:
A.aA.b...A.z
Now I want to create a struct B, with the same fields:
B.aB.b...B.z
With
B=struct(A)
B has also the same size as A, and all values of A are also included. But I want to have an empty struct with 0x1 dimension.
Background: in a loop I want to sort out some entries of A, that fit a certain criteria and write it into B. If I do
B=struct([])B(n)=A(m)
then the structs do not match. Therefore I want to create B in advance and then assign it.
Best Answer