Is there a quick method to remove data from a structure?
1 次查看(过去 30 天)
显示 更早的评论
I'm trying to remove data from my structure (ie first 27000 points).
I am aware of a method I could use (demonstrated below), but I was wondering if there is a more efficient method?:
Data2.Time = Data2.Time(27000:end)
Data2.MissingData(27000:end)
Data2.TimeStampsMatlab(27000:end)
Data2.Range(27000:end)
Data2.Vel_Beam1(:,27000:end)
I have 100+ variables so ideally I don't have to do this..
Thanks!
2 个评论
采纳的回答
Guillaume
2017-10-9
If I understood correctly, all that would be needed is:
Data2 = structfun(@(fld) fld(:, 27000:end), Data2, 'UniformOutput', false);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!