Create cell arrays and variables out of structures

3 views (last 30 days)
Hey guys can you help me please.
I have a structure inside another structure and in this strucutre there are cells with arrays(4x100 double).
I wanted to get these cells out of the structure and convert them to a matrix so that every single array gets an variable for it's own. It's like struct.struct.cell.
I tried a for-loop that indexes the cells but it did not work. Maybe it is possible to get them row-and column-wise.
On the picture you can see the two structures and the cells/fields which I want to convert to variables.
Are there any other solutions ?
Thank you for your help.
  1 Comment
Stephen23
Stephen23 on 8 Nov 2019
Edited: Stephen23 on 12 Nov 2019
Ri_Zelle = SAM.Innenwiderstand.Ri_Zelle;
Ri_fit = SAM.Innenwiderstand.Ri_fit;
SOC = SAM.Innenwiderstand.SOC;
... etc.
"...so that every single array gets an variable for it's own"
That would not be a good approach. Read this to know why:
You might find this useful:

Sign in to comment.

Answers (0)

Categories

Find more on Cell Arrays 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!