Changing Structure Array fields to multiple different column vectors
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Austin Baggetta
il 10 Mag 2020
Risposto: Ankriti Sachan
il 13 Mag 2020
Hi everyone, I need some help. I've created a structure array that is a 771x1 structure with three fields. All three fields are separate cell arrays, however I need fields 2 and 3 to be 771 different column vectors, any thoughts?
For example, the "Frame" field has an 89x1 double, a 45x1 double, a 38x1 double, etc., but I need them to be separate column vectors. num2cell turns everything into one long vector. The "Frame" vector corresponds to the "xy" field I have, which contains different particle's positions. This is why the "Frame" field needs to be separate column vectors, as each particle is in a specific number of frames.
Thank you for your help!
1 Commento
Sindar
il 11 Mag 2020
It sounds like a table may be a better way of storing your data. struct2table might work
Risposta accettata
Ankriti Sachan
il 13 Mag 2020
According to the explanation, it looks like you want to change the vectors in the "Frame" field into an [1X1] array. If it is correct, then you probably need to programmatically work on your structure’s field to bring it to a specific dimension array. You can try merging arrays into one and then reshape it according to your need. You can have a look at these links:
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Type Conversion in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!