Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- u=10:4:50;
- y=[10 20 25 30 40 50 55 60 65 70 75];
- plot ( u,y)
- grid,title('sistemul de indentificat');
- sy=0;
- su=0;
- suy=0;
- su2=0;
- N=length(u);
- for i=1:N
- sy=sy+y(i);
- su=su+u(i);
- suy=suy+u(i)*y(i);
- su2=su2+u(i)*u(i);
- end
- a=(su*suy-su2*sy)/(su*su-su2*N);
- b=(suy*N-su*sy)/(su2*N-su*su);
- c=(su*N-su2*sy)/(sy*sy-su*su);
- ym=a*u.^2+b*u+c;
- figure
- plot(u,ym)
- hold on
- plot(u,y,':')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement