16-Oct-2013 1> (-1)^(1/3) ans = 0.50000 + 0.86603i 2> i^2 ans = -1 3> x = linspace(1-1.e-5,1+1.e5); 4> plot(x, (1-x).^3) 5> x = linspace(1-1.e-5,1+1.e-5); 6> plot(x, (1-x).^3) 7> hold on 8> plot(x, 1 - 3*x + 3*x.^2 - x.^3, 'r') 9> hold off 10> (1 + 2*i)/(4 + 3*i) ans = 0.40000 + 0.20000i 11> z = 4 + 3*i z = 4 + 3i 12> z = 4 + 3i z = 4 + 3i 13> real(z) ans = 4 14> imag(z) ans = 3 15> abs(z) ans = 5 16> conj(z) ans = 4 - 3i 17> help conj 'conj' is a built-in function -- Mapping Function: conj (Z) Return the complex conjugate of Z, defined as `conj (Z)' = X - IY. See also: real, imag Additional help for built-in functions and operators is available in the online version of the manual. Use the command 'doc ' to search the manual index. Help and information about Octave is also available on the WWW at http://www.octave.org and via the help@octave.org mailing list. 18> compass(z) 19> grid on 20> w = complex(1,2) w = 1 + 2i 21> hold on 22> compass(w, 'r') 23> compass(z + w, 'g') 24> compass(z - w, 'k') 25> cart2polar(4,3) error: 'cart2polar' undefined near line 25 column 1 25> help cart2polar error: help: 'cart2polar' not found 25> help polar2cart 'polar2cart' is a function from the file C:\cygwin\home\achilles\polar2cart.m polar2cart Additional help for built-in functions and operators is available in the online version of the manual. Use the command 'doc ' to search the manual index. Help and information about Octave is also available on the WWW at http://www.octave.org and via the help@octave.org mailing list. 26> help cart2pol 'cart2pol' is a function from the file C:\Octave\Octave3.6.4_gcc4.6.2\share\octave\3.6.4\m\general\cart2pol.m -- Function File: [THETA, R] = cart2pol (X, Y) -- Function File: [THETA, R, Z] = cart2pol (X, Y, Z) -- Function File: [THETA, R] = cart2pol (C) -- Function File: [THETA, R, Z] = cart2pol (C) -- Function File: P = cart2pol (...) Transform Cartesian to polar or cylindrical coordinates. THETA describes the angle relative to the positive x-axis. R is the distance to the z-axis (0, 0, z). X, Y (and Z) must be the same shape, or scalar. If called with a single matrix argument then each row of C represents the Cartesian coordinate (X, Y (, Z)). If only a single return argument is requested then return a matrix P where each row represents one polar/(cylindrical) coordinate (THETA, PHI (, Z)). See also: pol2cart, cart2sph, sph2cart Additional help for built-in functions and operators is available in the online version of the manual. Use the command 'doc ' to search the manual index. Help and information about Octave is also available on the WWW at http://www.octave.org and via the help@octave.org mailing list. 27> cart2pol(4,3) error: 'z' undefined near line 79 column 24 error: called from: error: C:\Octave\Octave3.6.4_gcc4.6.2\share\octave\3.6.4\m\general\cart2pol.m at line 79, column 11 27> [theta, rho] = cart2pol(4,3) theta = 0.64350 rho = 5 28> theta_in_gradi = theta * 180/pi theta_in_gradi = 36.870 29> help pol2cart 'pol2cart' is a function from the file C:\Octave\Octave3.6.4_gcc4.6.2\share\octave\3.6.4\m\general\pol2cart.m -- Function File: [X, Y] = pol2cart (THETA, R) -- Function File: [X, Y, Z] = pol2cart (THETA, R, Z) -- Function File: [X, Y] = pol2cart (P) -- Function File: [X, Y, Z] = pol2cart (P) -- Function File: C = pol2cart (...) Transform polar or cylindrical to Cartesian coordinates. THETA, R, (and Z) must be the same shape, or scalar. THETA describes the angle relative to the positive x-axis. R is the distance to the z-axis (0, 0, z). If called with a single matrix argument then each row of P represents the polar/(cylindrical) coordinate (X, Y (, Z)). If only a single return argument is requested then return a matrix C where each row represents one Cartesian coordinate (X, Y (, Z)). See also: cart2pol, sph2cart, cart2sph Additional help for built-in functions and operators is available in the online version of the manual. Use the command 'doc ' to search the manual index. Help and information about Octave is also available on the WWW at http://www.octave.org and via the help@octave.org mailing list. 30> [a, b] = plo2cart(theta, rho) error: 'plo2cart' undefined near line 30 column 11 30> [a, b] = pol2cart(theta, rho) a = 4 b = 3 31> angle(z) ans = 0.64350 32> theta theta = 0.64350 33> 0/0 ans = NaN 34> 1/0 ans = Inf 35> -1/0 ans = -Inf 36> Inf/Inf ans = NaN 37> a a = 4 38> A = 5 A = 5 39> a a = 4 40> A A = 5 41> a2 = 7 a2 = 7 42> 2a = 8 parse error: syntax error >>> 2a = 8 ^ 42> esempio error: 'esempio' undefined near line 42 column 1 42> % esempio 42> # esempio 42> quit