Curve smoothing using smooth

6 ビュー (過去 30 日間)
Shalini
Shalini 2012 年 4 月 10 日
I have been reading doc smooth and have the following to code to carry out smoothing.However, when I run it, its just the heading I have.
>> x=xlsread('H2T_1.xls',1,'Z843:Z1053');
>> y=xlsread('H2T_1.xls',1,'AA843:AA1053');
>> yy1 = smooth(x,y,0.1,'loess');
yy2 = smooth(x,y,0.1,'rloess');
>> [xx,ind] = sort(x);
subplot(2,1,1)
plot(xx,y(ind),'b.',xx,yy1(ind),'r-')
set(gca,'YLim',[-1.5 3.5])
legend('Original Data','Smoothed Data Using ''loess''',...
'Location','NW')
subplot(2,1,2)
plot(xx,y(ind),'b.',xx,yy2(ind),'r-')
set(gca,'YLim',[-1.5 3.5])
legend('Original Data','Smoothed Data Using ''rloess''',...
'Location','NW')
Can anyone help and guide, whats wrong?

回答 (1 件)

Tom Lane
Tom Lane 2012 年 4 月 10 日
It works just fine for me, if I make up random data. Try looking at x, y, yy1, and yy2. If that doesn't make it clear what went wrong, you'll have to supply more details.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by