Interpolating a double array

2 ビュー (過去 30 日間)
Vaultec
Vaultec 2014 年 7 月 1 日
編集済み: Youssef Khmou 2014 年 7 月 2 日
So far I am given a plot that is a 33x1 double. How do I interpolate the data so I can have a total of 1000 data sets?
I dont quite get how to use the interp1 or interp2 function in this case.
attached is the figure
In addition after I have got the derivative of the data, how do i find the zeroes on it? (figure14)

採用された回答

Youssef  Khmou
Youssef Khmou 2014 年 7 月 2 日
編集済み: Youssef Khmou 2014 年 7 月 2 日
There is an alternative to interpolation functions :
% Given the vector r of 33x1 :
r=randn(33,1);
y=upsample(r,30);
% y is 990x1

その他の回答 (1 件)

dpb
dpb 2014 年 7 月 1 日
編集済み: dpb 2014 年 7 月 2 日
Presuming you have x,y in order to have generated the plots (if not, simply retrieve 'x|ydata' from the axes)
A)
xi=linspace(x(1),x(end),1000); % 1000 points between x range
yi=interp1(x,y,xi); % interpolate at those points
B)
xinflect=find(abs(sign(diff(y)),2)==2); % find points slope changes sign
NB: the above finds all points of maxima/minima, if need which keep the sign and select based on it. I'll leave which is which as "exercise for the student"... :)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by