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 commentaires

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?
The symbols are the data which I have with me, alpha is represented in degrees

Connectez-vous pour commenter.

 Réponse acceptée

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., ...

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by