addtoheap.m

来自「用matlab实现图像融合」· M 代码 · 共 28 行

M
28
字号
function H = addtoheap(F, H)%------------------------------------------------------------------------------%% Appends 2D gridfunction to 1D storage (heap) H.%% Note: because of reasons of efficiency we opt for columnwise storage as%       in Matlab. This is also how Fortran stores matrices.%% See also: storeR, storeQ.%% Design and implementation by:% Dr. Paul M. de Zeeuw <Paul.de.Zeeuw@cwi.nl>  http://homepages.cwi.nl/~pauldz/% Last Revision: May 5, 2002.% Copyright 2002 Stichting CWI, Amsterdam%------------------------------------------------------------------------------[nH, mH] = size(H);if ~isempty(H)  if mH ~= 1    error(' addtoheap - heap should be column vector ')  endend% [nF, mF] = size(F);% H = [H reshape(F, 1, nF*mF)]; i.e. storage as rowvector until dd020505% H = [H reshape(F, nF*mF, 1)]; i.e. storage as columnvector, but the following%                               is straightforward and equivalent:H = [H; F(:)];%------------------------------------------------------------------------------

⌨️ 快捷键说明

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