sin(0)/0 Warning: Divide by zero. ans = NaN 1/0 Warning: Divide by zero. ans = Inf -1/0 Warning: Divide by zero. ans = -Inf x=linspace(-3*pi,3*pi); y=sin(x)./x; isnan(y) ans = Columns 1 through 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 15 through 28 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 29 through 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 43 through 56 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 57 through 70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 71 through 84 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 85 through 98 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 99 through 100 0 0 find(isnan(y)) ans = Empty matrix: 1-by-0 x=linspace(-3*pi,3*pi,101); y=sin(x)./x; Warning: Divide by zero. find(isnan(y)) ans = 51 y y = Columns 1 through 8 0.0000 0.0203 0.0407 0.0605 0.0789 0.0954 0.1091 0.1195 Columns 9 through 16 0.1261 0.1284 0.1261 0.1192 0.1076 0.0914 0.0710 0.0468 Columns 17 through 24 0.0196 -0.0101 -0.0412 -0.0729 -0.1039 -0.1334 -0.1600 -0.1827 Columns 25 through 32 -0.2004 -0.2122 -0.2171 -0.2145 -0.2036 -0.1842 -0.1559 -0.1189 Columns 33 through 40 -0.0733 -0.0196 0.0416 0.1093 0.1826 0.2601 0.3406 0.4226 Columns 41 through 48 0.5046 0.5848 0.6618 0.7341 0.8000 0.8584 0.9079 0.9475 Columns 49 through 56 0.9765 0.9941 NaN 0.9941 0.9765 0.9475 0.9079 0.8584 Columns 57 through 64 0.8000 0.7341 0.6618 0.5848 0.5046 0.4226 0.3406 0.2601 Columns 65 through 72 0.1826 0.1093 0.0416 -0.0196 -0.0733 -0.1189 -0.1559 -0.1842 Columns 73 through 80 -0.2036 -0.2145 -0.2171 -0.2122 -0.2004 -0.1827 -0.1600 -0.1334 Columns 81 through 88 -0.1039 -0.0729 -0.0412 -0.0101 0.0196 0.0468 0.0710 0.0914 Columns 89 through 96 0.1076 0.1192 0.1261 0.1284 0.1261 0.1195 0.1091 0.0954 Columns 97 through 101 0.0789 0.0605 0.0407 0.0203 0.0000 plot(x,y) grid y(isnan(y))=1 y = Columns 1 through 8 0.0000 0.0203 0.0407 0.0605 0.0789 0.0954 0.1091 0.1195 Columns 9 through 16 0.1261 0.1284 0.1261 0.1192 0.1076 0.0914 0.0710 0.0468 Columns 17 through 24 0.0196 -0.0101 -0.0412 -0.0729 -0.1039 -0.1334 -0.1600 -0.1827 Columns 25 through 32 -0.2004 -0.2122 -0.2171 -0.2145 -0.2036 -0.1842 -0.1559 -0.1189 Columns 33 through 40 -0.0733 -0.0196 0.0416 0.1093 0.1826 0.2601 0.3406 0.4226 Columns 41 through 48 0.5046 0.5848 0.6618 0.7341 0.8000 0.8584 0.9079 0.9475 Columns 49 through 56 0.9765 0.9941 1.0000 0.9941 0.9765 0.9475 0.9079 0.8584 Columns 57 through 64 0.8000 0.7341 0.6618 0.5848 0.5046 0.4226 0.3406 0.2601 Columns 65 through 72 0.1826 0.1093 0.0416 -0.0196 -0.0733 -0.1189 -0.1559 -0.1842 Columns 73 through 80 -0.2036 -0.2145 -0.2171 -0.2122 -0.2004 -0.1827 -0.1600 -0.1334 Columns 81 through 88 -0.1039 -0.0729 -0.0412 -0.0101 0.0196 0.0468 0.0710 0.0914 Columns 89 through 96 0.1076 0.1192 0.1261 0.1284 0.1261 0.1195 0.1091 0.0954 Columns 97 through 101 0.0789 0.0605 0.0407 0.0203 0.0000 plot(x,y) sin(sym(0))/sym(0) ans = NaN syms x limit(sin(x)/x) ans = 1 n=0 n = 0 n=n+1,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1 ans = 1 2 4 n=n+1,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 2 ans = 2.0000 2.2500 3.3750 n=n+1,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 3 ans = 3.0000 2.3704 3.1605 n=n+1,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 4 ans = 4.0000 2.4414 3.0518 n=n+1,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 5 ans = 5.0000 2.4883 2.9860 n=n+1,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 6 ans = 6.0000 2.5216 2.9419 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 106 ans = 106.0000 2.7056 2.7311 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 206 ans = 206.0000 2.7117 2.7249 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 306 ans = 306.0000 2.7139 2.7227 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 406 ans = 406.0000 2.7149 2.7216 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 506 ans = 506.0000 2.7156 2.7210 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 606 ans = 606.0000 2.7160 2.7205 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 706 ans = 706.0000 2.7164 2.7202 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 806 ans = 806.0000 2.7166 2.7200 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 906 ans = 906.0000 2.7168 2.7198 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1006 ans = 1.0e+003 * 1.0060 0.0027 0.0027 format long n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1106 ans = 1.0e+003 * 1.10600000000000 0.00271705396642 0.00271951061558 format rat n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1206 ans = 1206 1758/647 1289/474 format n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1306 ans = 1.0e+003 * 1.3060 0.0027 0.0027 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1406 ans = 1.0e+003 * 1.4060 0.0027 0.0027 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1506 ans = 1.0e+003 * 1.5060 0.0027 0.0027 format long n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1606 ans = 1.0e+003 * 1.60600000000000 0.00271743602173 0.00271912807405 exps(1) ??? Undefined command/function 'exps'. exp(1) ans = 2.71828182845905 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1706 ans = 1.0e+003 * 1.70600000000000 0.00271748557346 0.00271907847239 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1806 ans = 1.0e+003 * 1.80600000000000 0.00271752964052 0.00271903436346 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 1906 ans = 1.0e+003 * 1.90600000000000 0.00271756908576 0.00271899488276 n=n+100,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 2006 ans = 1.0e+003 * 2.00600000000000 0.00271760460008 0.00271895933816 n=n+1000,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 3006 ans = 1.0e+003 * 3.00600000000000 0.00271782982361 0.00271873395861 n=n+1000,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 4006 ans = 1.0e+003 * 4.00600000000000 0.00271794262976 0.00271862109772 n=n+1000,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 5006 ans = 1.0e+003 * 5.00600000000000 0.00271801037579 0.00271855332632 n=n+1000,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 6006 ans = 1.0e+003 * 6.00600000000000 0.00271805556580 0.00271850812251 n=n+1000,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 7006 ans = 1.0e+003 * 7.00600000000000 0.00271808785713 0.00271847582286 n=n+1000,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 8006 ans = 1.0e+003 * 8.00600000000000 0.00271811208260 0.00271845159198 n=n+1000,[n,(1+1/n)^n,(1+1/n)^(n+1)] n = 9006 ans = 1.0e+003 * 9.00600000000000 0.00271813092877 0.00271843274211 diary off P = [1,1,1,-1,-1,-1] P = 1 1 1 -1 -1 -1 R = roots(P) R = 1.00000000000000 -0.49999999054323 + 0.86602541667492i -0.49999999054323 - 0.86602541667492i -0.50000000945678 + 0.86602539089396i -0.50000000945678 - 0.86602539089396i poly(R(2:3)) ans = 1.00000000000000 0.99999998108645 1.00000001287020 poly(R(4:5)) ans = 1.00000000000000 1.00000001891355 0.99999998712981 syms x V = solve(x^4-15*x^3+83*x^2-359*x+290) V = 1 10 2+5*i 2-5*i poly([2+5*i,2-5*i]) ans = 1 -4 29 poly([1+i,1-i,2,2]) ans = 1 -6 14 -16 8 A=[1,0,0,0,0,0,-1] A = 1 0 0 0 0 0 -1 roots(A) ans = -1.00000000000000 -0.50000000000000 + 0.86602540378444i -0.50000000000000 - 0.86602540378444i 0.50000000000000 + 0.86602540378444i 0.50000000000000 - 0.86602540378444i 1.00000000000000 r=ans r = -1.00000000000000 -0.50000000000000 + 0.86602540378444i -0.50000000000000 - 0.86602540378444i 0.50000000000000 + 0.86602540378444i 0.50000000000000 - 0.86602540378444i 1.00000000000000 poly(r) ans = Columns 1 through 4 1.00000000000000 0.00000000000000 -0.00000000000000 -0.00000000000000 Columns 5 through 7 -0.00000000000000 0.00000000000000 -1.00000000000000 poly(r(2:3)) ans = 1.00000000000000 1.00000000000000 1.00000000000000 poly(r(4:5)) ans = 1.00000000000000 -1.00000000000000 1.00000000000000 A=[1,0,0,0,0,0,1] A = 1 0 0 0 0 0 1 roots(A) ans = -0.86602540378444 + 0.50000000000000i -0.86602540378444 - 0.50000000000000i -0.00000000000000 + 1.00000000000000i -0.00000000000000 - 1.00000000000000i 0.86602540378444 + 0.50000000000000i 0.86602540378444 - 0.50000000000000i r=ans r = -0.86602540378444 + 0.50000000000000i -0.86602540378444 - 0.50000000000000i -0.00000000000000 + 1.00000000000000i -0.00000000000000 - 1.00000000000000i 0.86602540378444 + 0.50000000000000i 0.86602540378444 - 0.50000000000000i poly(r(1:2)) ans = 1.00000000000000 1.73205080756888 1.00000000000000 poly(r(3:4)) ans = 1.00000000000000 0.00000000000000 1.00000000000000 poly(r(5:6)) ans = 1.00000000000000 -1.73205080756888 1.00000000000000 R=[2 -1 3 -1 1] R = 2 -1 3 -1 1 P=[1 -2 4] P = 1 -2 4 [a,b]=deconv(R\P] ??? [a,b]=deconv(R\P] | Error: Unbalanced or misused parentheses or brackets. [a,b]=deconv(R,P) a = 2 3 1 b = 0 0 0 -11 -3 R=[2 -1 0 3 -1 1] R = 2 -1 0 3 -1 1 [a,b]=deconv(R,P) a = 2 3 -2 -13 b = 0 0 0 0 -19 53 R=[3 2 -1 1] R = 3 2 -1 1 P=[3 2] P = 3 2 [a,b]=deconv(R,P) a = 1.00000000000000 0 -0.33333333333333 b = 0 0 0 1.66666666666667 R=[3 2 -1 0 1] R = 3 2 -1 0 1 [a,b]=deconv(R,P) a = 1.00000000000000 0 -0.33333333333333 0.22222222222222 b = Columns 1 through 4 0 0 0 0 Column 5 0.55555555555556 5\9 ans = 1.80000000000000 5/9 ans = 0.55555555555556 2/9 ans = 0.22222222222222 exit