dssize.m
来自「实现地震勘探中」· M 代码 · 共 68 行
M
68 行
function [nrows,ncols]=dsSize(dataset,dim)% Find the number of rows and/or columns of the data matrix for the % following datasets:% "pseudo-wells", "tables", "seismic"%% Written by: E. R.: July 26, 2006% Last updated:%% [nrows,ncols]=dsSize(dataset,dim)% INPUT% dataset dataset name% dim optional dimension for which to compute length (like size(a,2))% OUTPUT% nrows number of rows% ncols number of columns% Check inputtry typ=dataset.type;catch error('Dataset must be a structure with a field "type".')endif nargout == 2 && nargin == 2 error('There can only one input argument if two output arguments are requested.')endif nargin == 1 switch typ case 'pseudo-wells' [nrows,ncols]=panelsize(dataset); case 'table' [nrows,ncols]=tablesize(dataset); case 'seismic' [nrows,ncols]=size(dataset.traces); otherwise error(['Unsupported dataset type: ',typ]) endelseif nargin == 2 switch typ case 'pseudo-wells' nrows=panelsize(dataset,dim); case 'table' nrows=tablesize(dataset,dim); case 'seismic' nrows=size(dataset.traces,dim); otherwise error(['Unknown dataset type: ',typ]) end else error('Wrong number of input arguments.')end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?