function cviceni2()

[A,b] = mkd1d(1,@sin,pi,10);
full(A)
[A,b] = mkd1d(1,@sin,pi,10);
full(A)
pi/11
1/ans^2
u = A\b;
h = pi/11; x = 0:h:pi; plot(x,[0,u',0])
n = 3;
l = pi;
[A,b] = mkd1d(1,@sin,l,n);
full(A)
u = A\b;
h = l/(n+1); x = 0:h:l; hold on; plot(x,[0,u',0],'r')
h = 0.01; x = 0:h:0.01; hold on; plot(x,sin(x),'k')
h = 0.01; x = 0:h:l; hold on; plot(x,sin(x),'k')
close all
h = 0.01; x = 0:h:l; plot(x,0.5*x.*(x-pi),'k')
[A,b] = mkd1d(1,@sin,l,n);
b
u = A\b; u
u = A\[1;1;1]; u
close all
h = 0.01; x = 0:h:l; plot(x,0.5*x.*(pi-x),'k')
[A,b] = mkd1d(1,@1,l,n);
[A,b] = mkd1d(1,1,l,n);
[A,b] = mkd1d(1,@sila,l,n);
n
u = A\b; u;
h = l/(n+1); x = 0:h:l; hold on; plot(x,[0,u',0],'r')
n = 10;
[A,b] = mkd1d(1,@sila,l,n);
h = l/(n+1); x = 0:h:l; hold on; plot(x,[0,u',0],'b')
u = A\b; u;
h = l/(n+1); x = 0:h:l; hold on; plot(x,[0,u',0],'b')
A
full(A)
tau = 1;
n = 10;
n = 3;
h = 0.01; x = 0:h:l; plot(x,-sin(x)+tau+cos(l),'k')
h = 0.01; x = 0:h:l; plot(x,sin(x)+tau-cos(l),'k')
[A,b] = mkd1d_NeumannVpravo(p,f,tau,l,n);
[A,b] = mkd1d_NeumannVpravo(1,@sin,tau,l,n);
u = A\b;
h = l/(n+1); x = 0:h:l; hold on; plot(x,[0,u'],'b')
close all
h = 0.01; x = 0:h:l; plot(x,sin(x)+(tau-cos(l))*x,'k')
h = l/(n+1); x = 0:h:l; hold on; plot(x,[0,u'],'b')
n = 10;
[A,b] = mkd1d_NeumannVpravo(1,@sin,tau,l,n);
u = A\b;
h = l/(n+1); x = 0:h:l; hold on; plot(x,[0,u'],'r')
l
full(A)
b
>>
close all
h = 0.01; x = 0:h:l; plot(x,sin(x)+(tau-cos(l))*x,'k')
n = 3;
[A,b] = mkd1d_NeumannVpravo(1,@sin,tau,l,n); u = A\b;
h = l/(n+1); x = 0:h:l; hold on; plot(x,[0,u'],'b')
n
n = 10;
[A,b] = mkd1d_NeumannVpravo(1,@sin,tau,l,n); u = A\b;
h = l/(n+1); x = 0:h:l; hold on; plot(x,[0,u'],'r')