comparison scripts/linear-algebra/logm.m @ 11472:1740012184f9

Use uppercase for variable names in error() strings to match Info documentation. Only m-files done.
author Rik <octave@nomad.inbox5.com>
date Sun, 09 Jan 2011 21:33:04 -0800
parents 994e2a93a8e2
children ff7e0776ba0f
comparison
equal deleted inserted replaced
11471:994e2a93a8e2 11472:1740012184f9
44 if (nargin == 0 || nargin > 2) 44 if (nargin == 0 || nargin > 2)
45 print_usage (); 45 print_usage ();
46 endif 46 endif
47 47
48 if (! issquare (A)) 48 if (! issquare (A))
49 error ("logm: argument must be a square matrix"); 49 error ("logm: A must be a square matrix");
50 endif 50 endif
51 51
52 [u, s] = schur (A); 52 [u, s] = schur (A);
53 53
54 if (isreal (A)) 54 if (isreal (A))
137 137
138 138
139 %!assert(norm(logm([1 -1;0 1]) - [0 -1; 0 0]) < 1e-5); 139 %!assert(norm(logm([1 -1;0 1]) - [0 -1; 0 0]) < 1e-5);
140 %!assert(norm(expm(logm([-1 2 ; 4 -1])) - [-1 2 ; 4 -1]) < 1e-5); 140 %!assert(norm(expm(logm([-1 2 ; 4 -1])) - [-1 2 ; 4 -1]) < 1e-5);
141 %!assert(logm([1 -1 -1;0 1 -1; 0 0 1]), [0 -1 -1.5; 0 0 -1; 0 0 0], 1e-5); 141 %!assert(logm([1 -1 -1;0 1 -1; 0 0 1]), [0 -1 -1.5; 0 0 -1; 0 0 0], 1e-5);
142 %! 142
143 %% Test input validation 143 %% Test input validation
144 %!error logm (); 144 %!error logm ();
145 %!error logm (1, 2, 3); 145 %!error logm (1, 2, 3);
146 %!error <logm: argument must be a square matrix> logm([1 0;0 1; 2 2]); 146 %!error <logm: A must be a square matrix> logm([1 0;0 1; 2 2]);