copy_parameters.m

来自「三谱混合相位子波估计!! 这是我的一篇文章所涉及到的matlab 源代码」· M 代码 · 共 30 行

M
30
字号
function structout=copy_parameters(structin,structout)
% Function copies all parameters of a log structure, seismic structure, or table  
% structure to another (parameter in a structure can be identified by an entry 
% in the 'parameter_info' field (cell array) of the structure); if a parameter 
% exists already in the output structure it will be overwritten.
% Written by: E. R.: October 6, 2005
% Last updated:
%
%            structout=copy_parameters(structin,structout)
% INPUT
% structin   structure from which the parameters are to be copied
% structout  structure to which the parameters are to be copied
% OUTPUT
% structout  structure to which the parameters are to be copied

if ~isstruct(structin)
   error(' First input data set must be a structure')
end

if ~isfield(structin,'parameter_info')
   return
end
params=structin.parameter_info(:,1);

for ii=1:length(params)
   structout=add_parameter(structout,getfield(structin,params{ii}), ...
                           structin.parameter_info(ii,:));
end

⌨️ 快捷键说明

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