show_basis.m

来自「A set of C++ and Matlab routines impleme」· M 代码 · 共 21 行

M
21
字号
%% Display the 2-D basis image
%%
%% f: 2-D signal
%% K: resolution of the basis image
%% h: axes on which we plot.

function show_basis(f, N, h);

MaxVal = max(abs(f(:)));
[R, C] = find(abs(f) == MaxVal);

f = f ./ MaxVal;

f = f(R(1) - N / 2 + 1 : R(1) + N / 2, C(1) - N / 2 + 1 : C(1) + N / 2);
dx = [-1 + 2/N : 2/N : 1];
dy = dx;

val = mesh(h, dy, dy, f);
axis([-1 1 -1 1 -1 1]);
view(0,90);
axis equal;

⌨️ 快捷键说明

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