Hello, I'm new to matlab. i want to plot a graph where x axis is in log scale and y axis is linear. The graph beow though shows straight line but I know the equation is not correct because It didn't pass throgh the scatter points
here is the code. Please help me, how can these line pass through the points and also how can i get the equation?
data=[0.891 35784.525582 0.91 39142.72 0.815 17679.26 0.891 25582 0.8861 30168.052] p1=data(:,2); %Re
q1=data(:,1); %Cd
scatter(p1,q1)set(gca,'XScale','log');pp = polyfit(log(p1), q1, 1)qq=exp(polyval(pp,log(p1)))hold onplot(p1, qq)hold off
Best Answer