source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/clean.m
@
37
Last change on this file since 37 was 37, checked in by , 14 years ago | |
---|---|
File size: 418 bytes |
Rev | Line | |
---|---|---|
[37] | 1 | function Z=clean(Z,tol) |
2 | %CLEAN Remove terms with small coefficients | |
3 | % | |
4 | % Z = clean(X,tol) removes all variables with a coefficient smaller than tol | |
5 | % | |
6 | % | |
7 | ||
8 | % Author Johan Löfberg | |
9 | % $Id: clean.m,v 1.1 2005/12/19 15:27:31 joloef Exp $ | |
10 | ||
11 | if nargin == 1 | |
12 | tol = 0; | |
13 | end | |
14 | basis_real = real(Z); | |
15 | basis_imag = imag(Z); | |
16 | basis_real(abs(basis_real)<tol) = 0; | |
17 | basis_imag(abs(basis_imag)<tol) = 0; | |
18 | Z = basis_real + sqrt(-1)*basis_imag; |
Note: See TracBrowser
for help on using the repository browser.