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