dimensional data string

1 visualización (últimos 30 días)
marciuc
marciuc el 31 de Mzo. de 2011
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 comentarios
Paulo Silva
Paulo Silva el 31 de Mzo. de 2011
I had some teachers like those in my time, good luck
Jan
Jan el 31 de Mzo. de 2011
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.

Iniciar sesión para comentar.

Respuestas (1)

Matt Tearle
Matt Tearle el 31 de Mzo. de 2011
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.

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by