Smoothing curve with duplicate values using pchip
1 次查看(过去 30 天)
显示 更早的评论
I have been using pchip interpolation to smooth curves plotted from data points. This has worked fine except I can't figure out how to smooth the curve when there are duplicate x values. This is what I have now:
Pressure27 = TC27Data.Pressurepsi;
Efficiency27 = TC27Data.Efficiency;
[xUnique, ia, ic] = unique(Pressure27);
yMeans = accumarray(ic, Efficiency27, [], @mean);
xq27 = [1500:.001:1250];
yqp27 = pchip(xUnique,yMeans,xq27);
plot(xUnique,yMeans,'linewidth',2);
This successfuly plots the averaged data point where there were duplicate values, however the curve that plots is not as smooth as I would like it, I want to get rid of the linear jagged edges. How can I use pchip here to smooth the curve? Thanks!
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!