
Corey G. answered 07/14/20
PhD in Computer Engineering with over 20 years of Teaching Experience
Either type these in one line at a time at the prompt to understand step by step, or store in a .m file and run. use the Matlab (or Octave) help function for commands do you don't understand.
x = [15.5 33.07 53.39 140.24 301.03]
y=[0.0491 0.0981 0.1962 0.4905 0.9810]
p = polyfit(x,y,1)
xp = 0:300
plot(xp,polyval(p,xp));
hold on
stem(x,y,'r');