フィルターのクリア

Resample issue with findpeaks

1 回表示 (過去 30 日間)
Matlabbey
Matlabbey 2012 年 8 月 15 日
Hi,
I'm not sure what the issue is so I will post the code and hopefully someone knows what's going on. :D
x = 1:numel(y); y = data;
xx = 1:2:numel(y);
yy = spline(x,y,xx);
I want to resample the data then use the spline function and then use findpeaks do find maximum values. Here is the problem:
Let's say I plot(xx) or plot(yy). It only shows 50 values. If I plot (xx,yy) I get 100 values. This issue is messing up the locations and values of the peaks...I'm not sure how to solve this. Does that make sense?
Thanks you for any suggestions!
  1 件のコメント
Walter Roberson
Walter Roberson 2012 年 8 月 16 日
Please show size(xx) and size(yy)

サインインしてコメントする。

回答 (1 件)

per isakson
per isakson 2012 年 8 月 16 日
編集済み: per isakson 2012 年 8 月 16 日
"Let's say I plot(xx) or plot(yy). It only shows 50 values. If I plot (xx,yy) I get 100 values." If size(xx) and size(yy) both are [1,50] then
plot( xx, yy, 'd' )
should give 50 points. However,
plot( [ xx, yy ], 'd' )
will give 100 points

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by