Info

This question is closed. Reopen it to edit or answer.

Grouping values for max and min in irregular data sets

1 view (last 30 days)
I have two large data sets. The second data set depends most of the time on the first data sets. But the problem is, dependancy might not be immediate. For an example, in some cases it might be after two cases, in some other, it might be after three cases. There might be cases right on top of it as well. This grouping cannot be done manually as the data set is large. So need to have a code. Consider the following data sets as an example.
x=[5 3 10 11 1 12 2 2 15 3]; Y=[10 2 1 15 20 2 25 1 30 1];
Consider a case where x(1) to y(1), x(3) to y(4), x(4) to y(5), x(9) to y(9).One way I am thinking of is, compare X(i) with Y(i:i+3) and select the Y corresponding to X. It is better if the program it self decide what is the value for selecting lower values and upper values, but for this example consider it to be 10 for Y.
Thanks, Thishan
  1 Comment
Steven Lord
Steven Lord on 17 Sep 2018
It's not clear to me what you're trying to do or what you're looking to implement. What does "x(3) to y(4)" mean? Why are x(3) and y(4) related somehow and not x(3) and y(1)?
Please start your explanation at the beginning, don't assume we have any background knowledge of your application.

Answers (1)

Thishan Dharshana Karandana Gamalathge
Suppose X variable represents daily Temperature. Suppose Y variable represents something depends on daily Temperature. Y may or may not directly relates to temperature of the corresponding day. Temperature today might relates with the Y on today, tomorrow, or the day after. So I want to group the cases where X relates best with Y out of those three cases.
In the given example what i meant by x(3) to y(4) is X(3) which is 10 relates well to Y(4) which is 15.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by