在MATLAB中,我有一个非常大的数据集,它排列成多个结构数组。结构看起来像这样:
Flight1=
.testpoint = 1
.Mach = 0.8
.Speed = 300
.Cieling = 35000
.Data = [A] % A is an MxN matrix同样,多个飞行有多个测试点。有没有办法只检索指定测试点的数据?例如,我想查看所有测试点的数据,这些测试点的.Mach = 0.8或.testpoint = 2?
我希望我已经说得足够清楚了。
发布于 2013-02-21 02:05:43
假设您有一个结构数组Flight,其中Flight( k )是一个包含您所描述的字段的结构,那么:
sel = [ Flight(:).Mach ] == 0.8; % select all flights with Mach == 0.8
poitEightMach = Flight( sel ); % selecting them into a separate struct array
sel = [Flight(:).testpoint] == 2;
testPoint2 = Flight( sel ); % select all flights with testpoint == 2https://stackoverflow.com/questions/14984610
复制相似问题