Increasing number of data points by linear interpolation method

35 次查看(过去 30 天)
I have attached a mat file. There are 7 datapoints in the matrix. This is a 7x2 matrix. How can I make it may be 70x2 matrix by linear interpolation method?
  1 个评论
Star Strider
Star Strider 2022-8-12
Creating data where none previously existed by interpolating it rather than performing more experiments or doing more observations to add new data is not appropriate.

请先登录,再进行评论。

回答(3 个)

John D'Errico
John D'Errico 2022-8-12
编辑:John D'Errico 2022-8-12
The problem is, as voiced by others, is it depends on why you are doing this. Certainly you can use interpolation tools to perform interpolation.
load('CPSH20152016.mat')
whos
Name Size Bytes Class Attributes CPSH20152016 7x2 112 double ans 1x41 82 char cmdout 1x33 66 char
plot(CPSH20152016(:,1),CPSH20152016(:,2),'-o')
What I see is a rather difficult to interpret set of points. Are these to be seen as a polygon, perhaps a reflection of some hysteresis phenomenon? Or is it just that the points are in no specific order, and we have what appears to be a rather noisy relationship?
Importantly though, you should NEVER use interpolation to create more data from sparse data. What you get will be a curve that depends more on the characteristics of the interpolant you use, then it does contain any information content. You gain no information content by interpolation.
If your goal is to merely create a pretty plot, then go ahead. Use an appropriate interpolation scheme. Here, that would depend on what the data means. Note that if you had problems in trying to use interp1, my guess is you wanted the result to follow the polygonal path. Interp1 does NOT do that kind of interpolation. For that, you will need to use tools like cscvn, or my own interparc, as found on the file exchange.
But again, you need to understand why it is you want to do that interpolation, and remember that you gain no signal from doing so.

Image Analyst
Image Analyst 2022-8-13
See my attached spline demos. You can tell it how many points you want.

Alan Stevens
Alan Stevens 2022-8-12
  2 个评论
Rik
Rik 2022-8-12
What problems did you have following the examples?
For the record: I share the concern voiced by Star Strider. Creating data is almost never a good idea. The only situation I can think of is if you want to generate example data, but that seems unlikely here.

请先登录,再进行评论。

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by