Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> plot(x, funkcja1(w, x), 'g-')
- >> plot(x, funkcja2(w, x),'r-')
- >> plot(x, polyval(w, x),'b-')
- >> plot(x, (x-1).^10)
- funkcja1:
- function o = funkcja1( w, x )
- a = 0;
- i = length(w);
- while i >= 1
- a = a + (w(i)*x.^(i-1));
- i = i - 1;
- end
- o = a;
- end
- funkcja2:
- function o = funkcja2( w, x )
- i = length(w);
- temp = 0;
- while i >= 1
- temp = temp.*x+w(i);
- i = i - 1;
- end
- o = temp;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement