Clear Filters
Clear Filters

I have 10 data points for 5 different trial, and when I would like to get a best fit line using polyfit and errorbars on data points. However, I get a matrix demenssion error. How can I account for this to execute these commands

1 view (last 30 days)
Hwater = 20.574;
IPH = 1./(Hwater + data.heights);
%plot (IPH(1:5),data.flowrates(1:5),'ob')
plot (IPH(1:5), data.flowrates(1:5,2:10),'ro')
hold on
errorbar(IPH(1:5),data.flowrates(1:5),errQ(1:5),'go')
D1=IPH(1:5);
R1=data.flowrates(1:5,2:10);
H=polyfit(D1,R1,1);
G=polyval(H,D1);
plot(IPH(1:5),G,'-')
***.jpg
This is what my grpah looks like

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!