source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/lightspeed/finddiag.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 430 bytes
Line 
1function i = finddiag(A,k)
2%FINDDIAG    Index elements on the diagonal.
3% FINDDIAG(A) returns the indices of the diagonal of A.
4% FINDDIAG(A,K) returns the indices of the K-th diagonal of A.
5%
6% See also DIAG, SETDIAG.
7
8% Written by Tom Minka
9% (c) Microsoft Corporation. All rights reserved.
10
11if nargin < 2
12  k = 0;
13end
14n = length(A);
15if k >= 0
16  i = (k*n+1):(n+1):(n^2);
17else
18  i = (1-k):(n+1):(n*(n+k));
19end
Note: See TracBrowser for help on using the repository browser.