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

📄 uoperation.m

📁 实现地震勘探中
💻 M
字号:
function ds=uoperation(ds,operator)% Function performs a unary operation on a dataset%% Written by: E. R.: December 7, 2006% Last updated:%%        ds=uoperation(i1,operator)% INPUT% i1     operand %        At least one of the two operands is a dataset.% operator   string defining operation to perform. Possible values are:%      '+', '-'% OUTPUT% ds    result of the operationif ~isfield(ds,'type')   error(['Operation "',operator,'" is not defined for this structure.'])endswitch ds.typecase 'seismic'   ds=uoperation4seismic(ds,operator);case 'pdf'   ds=uoperation4pdf(ds,operator);otherwise   error(['The operator "',operator,'" is not defined for this structure.'])end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function ds=uoperation4seismic(ds,operator)% Perform the operation defined by input argument "operator" to the % input argument%% Written by: E. R.: July 12, 2006% Last updated: %%       ds=uoperation4pdf(ds,operator)% INPUT% ds    seismic dataset % operation  string defining operation to perform. Possible values are:%      '+', '-'% OUTPUT% ds    result of the operationswitch operatorcase '+'     % Do nothingcase '-'    ds.traces=-ds.traces;   otherwise    disp([' Unknown operator "',operator,'".'])    error(' Abnormal termination.')	 end%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%function ds=uoperation4pdf(ds,operator)% Perform the operation defined by input argument "operator" to the % input argument%% Written by: E. R.: July 12, 2006% Last updated: September 16, 2006: Add handling of PDF's%%       ds=uoperation4pdf(i1,i2,operator)% INPUT% ds    PDF% operation  string defining operation to perform. Possible values are:%      '+', '-',% OUTPUT% ds    result of the operationswitch operatorcase '+'     % Do nothingcase '-'    ds.pdf=-ds.pdf;    try       ds.cdf=-ds.cdf;    catch       % Do nothing    endotherwise    disp([' Unknown operator "',operator,'".'])    error(' Abnormal termination.')	 end

⌨️ 快捷键说明

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