comparison scripts/special-matrix/toeplitz.m @ 7411:83a8781b529d

[project @ 2008-01-22 21:52:25 by jwe]
author jwe
date Tue, 22 Jan 2008 21:52:26 +0000
parents a1dbe9d80eee
children 81d6ab3ac93c
comparison
equal deleted inserted replaced
7410:8a3b2ccc4e11 7411:83a8781b529d
106 for i = 1:min (nr, nc-1) 106 for i = 1:min (nr, nc-1)
107 retval (i, i+1:nc) = r (2:nc-i+1); 107 retval (i, i+1:nc) = r (2:nc-i+1);
108 endfor 108 endfor
109 109
110 endfunction 110 endfunction
111
112 %!assert((toeplitz (1) == 1
113 %! && toeplitz ([1, 2, 3], [1; -3; -5]) == [1, -3, -5; 2, 1, -3; 3, 2, 1]
114 %! && toeplitz ([1, 2, 3], [1; -3i; -5i]) == [1, -3i, -5i; 2, 1, -3i; 3, 2, 1]));
115
116 %!error toeplitz ([1, 2; 3, 4], 1);
117
118 %!error toeplitz ();
119
120 %!error toeplitz (1, 2, 3);
121