필터 지우기
필터 지우기

Split an array based on defining a limit for the first value (left edge)

조회 수: 2 (최근 30일)
Joshua Pretorius
Joshua Pretorius 2021년 11월 10일
답변: KSSV 2021년 11월 10일
Hi all,
I have data for wind speed as shown in the image. The points of interest is when the data first hits 20, and from here, all points are recorded and stored in anh array until the data hits 30. All occasions where this trend occures are stored as seperate arrays within a cellarray. However, i am noticing that some of the arrays have incorrectly stored data. For example, "Array 2" incorrectly uses where the data first decreases below 30 as the first value, and then correctly records the final value where data next hits 30m/s. However, i want the first point of "Array 2" to start where data first reaches 20. The corrected version of Array 2 is visualised in orange.
Is there any way of defining a limit for the first value of all arrays generated? Such as for Array 2, i would like a code to read all data points in the array from left to right, and remove values so that the first value of the array becomes roughly 20 m/s (plus or minus 2 m/s).
Thanks very much !

답변 (1개)

KSSV
KSSV 2021년 11월 10일
You check the initial time value and final time value of the array. If they are not like what you wanted, you can do interpolation and get the values at the required dates. Read about interp1.

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by