Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Runge's Phenomenon
%To view plots after 'plot' (and other plot-producing commands) this command must follow: 'print -dpng some_unique_plot_name.png;' %It exports current plot to png image which then is sent to your browser %GNU Octave 4.2.2 function l = lagrangeBasis(xj,xe,f) n = length(xj); l = 0.0; for j = 1:n l1 = 1; u1 = 1; for k=1:n if (k~=j) l1 = l1*(xe-xj(k)); u1 = u1*(xj(j)-xj(k)); end end l = l + (l1/u1)*f(j); end end p = 500; n = 10; xe = -1 + 2*(0:p)/p; xj = -1 + 2*(0:n)/n; f = @(t) exp(-25*t.^2); l = zeros(1,p+1); for i = 1:p+1 l(i) = lagrangeBasis(xj,xe(i),f(xj)); end hold on plot(xe,l,"Linewidth",3,"Color",'r'); plot(xe,f(xe),"Linewidth",3,"Color",'b'); print -dpng saif.png;
run
|
edit
|
history
|
help
0
lab1.2
calculo de la impedancia compleja a partir de cinco medidas
Krylov.m
edit:Polygon inside a polygon
Vector square?
Krylov.m
bd
demo1.m
text5
Krylov.mX