dimensional data string

2 次查看(过去 30 天)
marciuc
marciuc 2011-3-31
I have an exercise in mathlab .....
load xx18.dat
load yy18.dat
plot(xx18,yy18)
a=mean(xx18)
b=mean(yy18)
c=mean(xx18.^2)
d=mean(yy18.^2)
e=mean(xx18.*yy18)
r=(e-a*b)/sqrt((c-a^2)*(d-b^2))
p=polyfit(xx18,yy18,2)
yt=polyval(p,xx18)
subplot(2,3,1)
plot(xx18,yy18,'r', xx18, yt)
title('Y(X) si Yteoretic(X)')
eroare= yy18-yt
subplot(2,3,2)
plot( eroare,xx18)
title('graficul erorii in raport cu X')
subplot(2,3,3)
plot(eroare,yt)
title('graficul erorii in raport cu Yteoretic')
subplot
load xx18.dat
load yy18.dat
plot(xx18,yy18)
a=mean(xx18)
b=mean(yy18)
c=mean(xx18.^2)
d=mean(yy18.^2)
e=mean(xx18.*yy18)
r=(e-a*b)/sqrt((c-a^2)*(d-b^2))
p=polyfit(xx18,yy18,2)
yt=polyval(p,xx18)
subplot(2,3,1)
plot(xx18,yy18,'r', xx18, yt)
title('Y(X) si Yteoretic(X)')
eroare= yy18-yt
subplot(2,3,2) plot( eroare,xx18) title('graficul erorii in raport cu X')
subplot(2,3,3)
plot(eroare,yt)
title('graficul erorii in raport cu Yteoretic')
subplot(2,3,4)
for i=2:length(eroare) hold on plot(eroare(i-1), eroare(i), '*') end
title('graficul punctelor succesive')
subplot(2,3,5)
hist(eroare,10)
title('histograma erorilor')
subplot(2,3,6)
normplot(eroare)
title('graficul probabilitatilor normale')
v=1:length(eroare)
m=polyfit(v,eroare,1)
How do I calculate the slope, where slope is 0 and the location is constant?
and i don't understand those graphs that are generated... 6 graphics ...and what involving them?
  4 个评论
Paulo Silva
Paulo Silva 2011-3-31
I had some teachers like those in my time, good luck
Jan
Jan 2011-3-31
I assume the titles over the diagrams contain some helpful hints... Sometimes asking even not normal persons yields to useful answers. It is always worth to try it.

请先登录,再进行评论。

回答(1 个)

Matt Tearle
Matt Tearle 2011-3-31
polyfit is finding the least-squares best fit to the data for a quadratic polynomial. polyval then evaluates this polynomial at the x data values. Hence yt is a vector of the y values for the fitted (theoretical) model. eroare is therefore the vector of residuals -- ie the difference between the y values predicted by the fitted model and the actual data.
The graphs are showing the data and the fitted model, then various investigations of the residuals, specifically independence and normality.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by