%-- 6.10.10 15:54 --% f = @(x) x^2-x-2; x = puleni(f,1,4,1e-5) f = @(x) sin(1/x); puleni(f,0.1,1,1e-16) ezplot(f) ezplot('sin(1/x)') clc clear c = faktorial(5) c = faktorial_r(5) c = faktorial_r(0) c = faktorial(0) c = faktorial_r(3) a=je_prvocislo(7) a=je_prvocislo1(7) a=je_prvocislo1(3) a=je_prvocislo1(7) a=je_prvocislo1(70) a=je_prvocislo1(2) isprime(70) clear clc doc symbolic help symbolic x=3 clc syms x x = sym('x') y = sym('y') d1 = sym('1/2+4/3') M = sym([2 1; 3 -2]) M = [2 1; 3 -2] sym x; y = cos(x^2) v = sqrt(sym(2)) v2=sqrt(2) clc clear sym x; p = 3*x^2 - 2*x + 6 1/2 + 1/3 format long 1/2 + 1/3 sym((1/2) + (1/3)) clear syms x y f = x^2 -2*x + 1 subs(f,1) subs(f,y) c1 = sym(1/5+3/4-1/6) double(c1) latex(f) A = sym(hilb(2)) % Hilbertova matice řádu 2 latex(A) f = x^3-6*x^2+11*x-6 pretty(f) exp(c*log(sqrt(a+b))) syms c exp(c*log(sqrt(a+b))) syms a b c exp(c*log(sqrt(a+b))) simplify(ans) v=exp(c*log(sqrt(a+b))) simplify(v) simple(v) clc syms a b a^2 - b^2 expand(ans) factor(ans) clear clc syms u ezplot(cos(u)) syms x y ezplot(x^2-y^6) figure ezplot(x^2-y^6) ezplot(cos(u)) close figure close all ezplot(cos(x),sin(x),[0 2*pi]) ezpolar(cos(x),sin(x),[0 2*pi]) ezpolar(cos(u)) clc figure syms u ezplot(cos(u)) h=ezplot(cos(u)) get(h) set(h,'color',[0 .3 0]) clear clc syms x int(x^2+3*x-5,0,2) syms x; f3 = int(x^2+3*x-5) i=subs(f3,2)-subs(f3,0) syms a x f = sin(a^2*x); diff(f) diff(f,a) diff(x^3+5*x^2-5*x,2); diff(x^3+5*x^2-5*x,2) clc syms x y = x^2+3*x-5; dy = diff(y) ezplot(y) % graf fce, modrá čára hold on % zachovat staré grafy h = ezplot(dy); set(h,'color',[1 0 0]) % graf derivace, červená čára hold off funtool close all clc limit(sin(x)/x) limit(sin(a)/a) limit(sin(a)/x) doc limit clc limit(1/x,x,0,'left') limit(1/x,x,0,'right') s1 = symsum(1/s^2,1,inf) syms s s1 = symsum(1/s^2,1,inf) s2=symsum(s^2,0,10) s_obec=symsum(s^2) subs(s_obec,11) clc dsolve('Dx = -a*x') dsolve('(Dy)^2 + y^2 = 1','s') dsolve('Dy = a*y', 'y(0) = b') z = dsolve('Dx = y', 'Dy = -x') z.y z.x clc syms a b c x solve('a*x^2+b*x+c') solve('a*x^2+b*x+c','b') S = solve('x + y = 1', 'x - 11*y = 5') S.x S.y clc syms a u v A = solve('a*u^2 + v^2', 'u - v = 1', 'a^2 - 5*a + 6') Aa = A.a, Au = A.u, Av = A.v double(subs([a*u^2+v^2, u-v-1, a^2-5*a+6], {a,u,v}, {Aa(3),Au(3),Av(3)})) clc clear %uloha 41 syms n limit((n^2+5*n+1)/(n^3-3),inf) limit(sqrt(n^3+2*n-1)/(n+2),inf) limit(symsum(n^2,1,n)/(2*n^3+n^2-1,inf)) limit(symsum(n^2,1,n)/(2*n^3+n^2-1),inf) %uloha 42 clear syms x a b limit((sin(x)/sin(a))^(1/(x-a)),x,a) limit(atan(1/1-x),x,1,'right') limit(atan(1/(1-x)),x,1,'right') limit(atan(1/(1-x)),1,'right') limit(atan(1/(1-x))1,'right') limit(atan(1/(1-x)),x,1,'right') clc clear %uloha 43 syms x F1=int(1/(1+x^2)) diff(F1) F3=int(x^2*log(x)) diff(F3) pretty(ans) clc %uloha 44 d1=diff(cos(3*x^2+2*x+1)^3 d1=diff(cos(3*x^2+2*x+1)^3) pretty(d1) d1=diff(cos(3*x^2+2*x+1)^3,2) d1=diff(cos(3*x^2+2*x+1)^3,3) pretty(d1) clc %uloha 45 symsum((-1)^{n+1)*(x-1)^n/n,n,1,inf) symsum((-1)^(n+1)*(x-1)^n/n,n,1,inf) syms n symsum((-1)^(n+1)*(x-1)^n/n,n,1,inf) clear clc %uloha 46 f= dsolve('D2y+2*Dy+2*y=0') syms x y=exp(-y)*sin(x) syms y y=exp(-y)*sin(x) diff(y,2)+2*diff(y)+2*y y=exp(-x)*sin(x) diff(y,2)+2*diff(y)+2*y clc clear uloha49 clear clc uloha50 clear clc asteroida(1) asteroida(2) asteroida(10) close asteroida(-10) asteroida(20) cykloida(2,2) cykloida(2,2,10*pi) spirala_archim(2) spirala_archim(20) figure spirala_archim(2) clear clc primka(1,-2,0,1,1,2) clc primka(1,-2,0,1,1,2)