Trimming structure of Arrays
Mostra commenti meno recenti
Hi Guys
I have a structure like this:
Data =
dateTime: [4906x1 double]
aircraftLat: [4906x1 double]
aircraftLong: [4906x1 double]
aircraftMSL: [4906x1 double]
aircraftSpeed: [4906x1 double]
aircraftCourse: [4906x1 double]
gcsLat: [4906x1 double]
gcsLong: [4906x1 double]
gcsMSL: [4906x1 double]
antAz: [4906x1 double]
antEl: [4906x1 double]
rssi: [4906x1 double]
I'd like to take the first 5 elements of each array and remove. Is there a neat solution for this? Or would I have to go into each array eg. Data.aircraftLat(1:5) = [], etc.
Thanks
Amir
Risposta accettata
Più risposte (2)
TAB
il 28 Set 2011
Data=structfun(@(x) ( x(6:end) ), Data,'UniformOutput', false);
Daniel Shub
il 28 Set 2011
It looks like all you arrays are the same size. You may want to consider a structure array instead of a structure with lots of arrays. This way you could then just do:
Data = Data(6:end);
to remove the first 5 elements.
Categorie
Scopri di più su Structures in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!