I want to plot a graph of a function fitted by two list of t and fp. A dependent variable fp is gotten by a independent variable t with a fitting function using "ployfit". I don't know how to plot a graph of the function ,even if I got "fp"s from "t" given arbitrarily.The code is shown below.
function y=fp(t)t_1=[0 0.15 0.49 2.1126];t_2=[2.27 3.53 8.78 25.45 42.80 43.68 44.08];p_1=9.80665*[331.2 614.3 505.4 607.8];p_2=9.80665*[48.65 43.97 42.01 41 40.8 40.79 2.22];y=polyfit(t_2,p_2,2)*[t.*t;t;1]*(t>=2.1126)+polyfit(t_1,p_1,2)*[t.*t;t;1]*(t>=0&&t<2.1126);end
Actually,the "plot" seems workable, but I need help to plot;
Best Answer