MATLAB: How to make a smooth line using following data

distinct valuesmatlab plotsmooth line

I tired to make the plot smooth with some interpolation functions. It says use distinct values. The elements of the vector are not distinct. The values are given.
x=[3.3,3.3,3.2,3.2,3.1,3,2.9,2.9,2.8,2.8,2.7,2.6,2.6,2.5]; y=[500,450,400,350,300,250,200,200,250,300,350,400,450,500];
Please help. Thanks in advance.

Best Answer

x=[3.3,3.3,3.2,3.2,3.1,3,2.9,2.9,2.8,2.8,2.7,2.6,2.6,2.5];
y=[500,450,400,350,300,250,200,200,250,300,350,400,450,500];
plot(x,y)
n = 5 ; % can be changed
p = polyfit(x,y,n);
x1 = linspace(min(x),max(x));
y1 = polyval(p,x1);
hold on
plot(x1,y1)
hold off