如何读取在MATLAB多重结构阵列的具体领域? [英] How to read specific fields from multiple structure arrays in MATLAB?

查看:132
本文介绍了如何读取在MATLAB多重结构阵列的具体领域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安排到MATLAB多重结构数组一个非常大的数据集。该结构是这个样子:

I have a very large dataset arranged into multiple structure arrays in MATLAB. The structures look something like this:

Flight1=   

.testpoint = 1
.Mach = 0.8
.Speed = 300
.Cieling = 35000
.Data = [A] % A is an MxN matrix

同样也有多个航班多个测试点。有没有一种方法来检索唯一指定的测试点的数据?例如,我想看看所有的测试点的.Mach = 0.8或者.testpoint = 2的数据?

Similarly there are multiple test points for multiple flights. Is there a way to retrieve the Data of only specified test points? For example I want to look at the Data of ALL the test points whose .Mach = 0.8 or where .testpoint = 2?

我希望我已很清楚。

推荐答案

假设你有一个结构阵列航班,其中航班(K)与你所描述,然后领域的结构:

Assuming you have a struct array Flight where Flight( k ) is a struct with the fields you described, then:

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 == 2

这篇关于如何读取在MATLAB多重结构阵列的具体领域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆