haarcoords.m
来自「一本很简单」· M 代码 · 共 24 行
M
24 行
function [x, y] = HaarCoords(c, normalization)% [x, y] = HaarCoords(c) returns x and y coordinates suitable for plotting a% piecewise-constant function on [0,1] with scaling function coefficients c.% Normalization can be either 'max' or 'L2'.% Check length of c.len = length(c);j = log(len)/log(2);if len ~= 2^j error('HaarCoords: c must be a vector of length 2^j.');end;% Scale appropriately for normalization.if strcmp(normalization, 'L2') c = c*2^(j/2);end;% Construct x and y positions.x = floor([0.5:0.5:len])/len;y(1:2:2*len) = c;y(2:2:2*len) = c;return;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?