Selecting specific data from raw data based on conditions

I have a huge set of data, I want to apply these conditions on the raw set of data so that the data which meets the criteria specified in the conditional equations only gets selected. Whats the best way to do that in matlab?

2 件のコメント

Walter Roberson
Walter Roberson 2015 年 12 月 15 日
How do the symbols translate into variable speed names or columns of your data? Is that a degree sign I see for alpha? If so then is alpha represented in degrees or in radians or is it a value to be calculated from the data?
Hawkins
Hawkins 2015 年 12 月 18 日
The symbols are the data which I have with me, alpha is represented in degrees

サインインしてコメントする。

 採用された回答

dpb
dpb 2015 年 12 月 15 日

1 投票

Using "logical addressing" is generally an efficient technique. I use a helper function I call iswithin to remove the complexity of the logical expressions from the higher level code but it's just "syntactic sugar" from an implementation standpoint...
>> type iswithin
function flg=iswithin(x,lo,hi)
% returns T for values within range of input
% SYNTAX:
% [log] = iswithin(x,lo,hi)
% returns T for x between lo and hi values, inclusive
flg= (x>=lo) & (x<=hi);
>>
Use would be something like
idxGd=iswithin(Gd,0,1.1*G);
idxG =iswithin(G,0,1.2*Goh);
and the overall a combination with the above for the actual data structure used as Walter notes. It's likely a single array and column indexing could be very effective here depending on the actual data availability, spacing, etc., etc., ...

その他の回答 (0 件)

質問済み:

2015 年 12 月 15 日

コメント済み:

2015 年 12 月 18 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by