say I have a data file with the first column being days and the second being prices. How would I go about creating an approximation I have named f for prices and plotting it the approximation against the original. So far I have tried.
day = Data(:,1);price =Data(:,2) ;p=polyfit(day,price,5); %N=5
f=polyval(p,day); %Approximation
hold onplot(day,price)plot(day,f)
I really appreciate any help if im in the right direction
Best Answer