Interpolation for 2 dependent output data

5 次查看(过去 30 天)
I have a table as shown below. Col 1 = input, Col 2 = output (consists of two outputs that depend on each other)
.
How do I interpolate for a point in input, say for e.g input = 0.0300?

回答(2 个)

John D'Errico
John D'Errico 2022-9-9
编辑:John D'Errico 2022-9-9
Trivial. You just have TWO interpolation problems. Interpolate output1 as a function of the input. Then interpolate output2, also as a function of the input.
Can you insure that the totally unknown dependency that you claim to exist between the outputs will be EXACTLY maintained? Of course not. But then we are not told how those outputs depend on each other, so we cannot infer some magical but unknown or unspecified dependence. Using the above approach, at best, the two outputs will still approximately maintain their unknown and unspecified relationship.
Now, suppose you told us that the dependence between outputs was something simple, AND known? For example...
output1 + output2 = 1
Then the solution is trivial, since you really do not have two independent outputs, but one of them can be trivially derived from the other. So interpolate output1 from the input. Use your favorite choice of interpolation method, perhaps a spline. Once you know output1, then compute output2 as:
output2 = 1 - output1
What is the problem? Is output2 also going to be a smoothly interpolated function of the input? YES. As long as output1 was a spline interpolate, then output2 will ALSO be an interpolated function of the input. (By the definition of interpolation, this will be provably true.) And the two outputs will still EXACTLY follow the given relationship.
So easy, peasy. You have not shown any data, nor have you given a hint as to what the relationship might be, so I can do no more than this.

Torsten
Torsten 2022-9-9
编辑:Torsten 2022-9-9
Why is there an 181x2 double matrix for each input value ?
If there are only two doubles for each input, first use interp1 for the first value, then use interp1 again for the second value. To do this, split the second column into two.
If you know how the two outputs depend on each other (i.e. you have a function f(input,output1) = output2), you can only interpolate output1 and use f to get output2.

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by