📄 dssize.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -