📄 l1qc_example.m
字号:
% l1qc_example.m%% Test out l1qc code (l1 minimization with quadratic constraint).%% Written by: Justin Romberg, Caltech% Email: jrom@acm.caltech.edu% Created: October 2005%% put optimization code in path if not already therepath(path, './Optimization');% signal lengthN = 512;% number of spikes to put downT = 20;% number of observations to makeK = 120;% random +/- 1 signalx = zeros(N,1);q = randperm(N);x(q(1:T)) = sign(randn(T,1));% measurement matrixdisp('Creating measurment matrix...');A = randn(K,N);A = orth(A')';disp('Done.'); % noisy observationssigma = 0.005;e = sigma*randn(K,1);y = A*x + e;% initial guess = min energyx0 = A'*y;% take epsilon a little bigger than sigma*sqrt(K)epsilon = sigma*sqrt(K)*sqrt(1 + 2*sqrt(2)/sqrt(K)); ticxp = l1qc_logbarrier(x0, A, [], y, epsilon, 1e-3);toc% large scale%Afun = @(z) A*z;%Atfun = @(z) A'*z;%tic%xp = l1qc_logbarrier(x0, Afun, Atfun, y, epsilon, 1e-3, 50, 1e-8, 500);%toc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -