Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [ wsp ] = aproksymacja(x,y,m)
- G = zeros(m+1,m+1);
- n = size(x);
- for i=0:m
- for j=0:m
- G(i+1,j+1) = sum(power(x,i+j));
- end
- end
- b = zeros(m+1,1);
- for k=0:m
- b(k+1) = sum(times(power(x,k),y));
- end
- a = G\b;
- a=a';
- wsp=fliplr(a);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement