⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makegauss.m

📁 为stanford大学donoho教授所编写的redgit变换源代码。是用c编写的
💻 M
字号:
function G = makeGauss(N, a, b, w)
% Make a half-plane Gaussian image of size N by N
% y = ax + b is the division line

if ~exist('w', 'var')
    w = 1;
end

x = linspace(-1,1,N);
y = linspace(-1,1,N);
[X,Y] = meshgrid(x,y);

% Gausssian
G = exp(-w *(X.^2 + Y.^2));

% Half plane
W = (Y <= a*X + b);

% Gaussian-windowed half-plane
G = G .* W;

% Image
imagesc(x,y,G), colorbar
xlabel('x'), ylabel('y')
axis square

% Surface
% figure;
% surfc(x,y,G); 				% surf plot with contour plot
% xlabel('x'), ylabel('y'), zlabel('f(x,y)')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -