Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8903767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:57:03+00:00 2026-06-15T01:57:03+00:00

I have a 1 second dataset of 86400 wind speed (WS) values in Matlab

  • 0

I have a 1 second dataset of 86400 wind speed (WS) values in Matlab and need assistance in filtering it. It requires a certain level of cleverness.

If the average WS exceeds:

  • 25m/s in a 600s time interval
  • 28m/s in a 30s time interval
  • 30m/s in a 3 s time interval

If any of these parameters are met, the WS is deemed ‘invalid’ until the average WS remains below 22m/s in a 300 s time interval.

Here is what I have for the 600 second requirement. I do a 600 and 300 second moving average on the data contained in ‘dataset’. I filter the intervals from the first appearance of an average 25m/s to the next appearance of a value below 22m/s as ‘NaN’. After filtering, I will do another 600 second average, and the intervals with values flagged with a NaN will be left a NaN.

i.e.

Rolling600avg(:,1) = tsmovavg(dataset(:,2), 's', 600, 1);

Rolling300avg(:,1) = tsmovavg(dataset(:,2), 's', 300, 1);

a = find(Rolling600avg(:,2)>25)

b = find(Rolling300avg(:,2)<22)

dataset(a:b(a:find(b==1)),2)==NaN; %?? Not sure

This is going to require a clever use of ‘find’ and some indexing. Could someone help me out? The 28m/s and 30m/s filters will follow the same method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:57:04+00:00Added an answer on June 15, 2026 at 1:57 am

    If I follow your question, one approach is to use a for loop to identify where the NaNs should begin and end.

    m = [19 19 19 19 28 28 19 19 28 28 17 17 17 19 29 18 18 29 18 29]; %Example data
    a = find(m>25);
    b = find(m<22); 
    m2 = m;
    % Use a loop to isolate segments that should be NaNs;
    for ii = 1:length(a)
         firstNull = a(ii) 
         lastNull  = b( find(b>firstNull,1) )-1 % THIS TRIES TO FIND A VALUE IN B GREATER THAN A(II)
         % IF THERE IS NO SUCH VALUE THEN NANS SHOULD FILL TO THE END OF THE VECTOR
         if isempty(lastNull), 
             lastNull=length(m); 
         end 
         m2(firstNull:lastNull) = NaN
    end
    

    Note that this only works if tsmovavg returns an equal length vector as the one passed to it. If not then it’s trickier and will require some modifications.

    There’s probably some way of avoiding a for loop but this is a pretty straight forward solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android MapView in which i need to have a second layer
I need to add a second DataTable from our app's main DataSet into a
I have two datasets need to merge. The first one is a big dataset
I have the following dataset (all positive values) Input file 1 2.3456 1 5.02
I have a dataset that contains observations for every second of four consecutive days
I have a dataset Sig of size 65536 x 192 in Matlab. If I
I have a second .nib file that is a localized version of the main
we want to have the second biggest element. We first use ANY to exclude
Is there a way in .NET to have a class property have a second
In the following code how can I still have the second and third statement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.