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

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

Added original make3d

File size: 434 bytes
Line 
1function A = setdiag(A,v,k)
2%SETDIAG  Modify the diagonal(s) of a matrix.
3% SETDIAG(A,V) returns a copy of A where the main diagonal is set to V.
4% V can be a scalar or vector.
5% SETDIAG(A,V,K) sets the K-th diagonal to V.  The K-th diagonal has length
6% N-ABS(K).
7%
8% See also DIAG, FINDDIAG.
9
10% Written by Tom Minka
11% (c) Microsoft Corporation. All rights reserved.
12
13if nargin < 3
14  k = 0;
15end
16A(finddiag(A,k)) = v;
Note: See TracBrowser for help on using the repository browser.