25 lines
633 B
Mathematica
25 lines
633 B
Mathematica
|
%
|
||
|
% -----------------
|
||
|
% Copyright © 2019 ACK Cyfronet AGH, Poland.
|
||
|
%
|
||
|
% This work was partially funded by EPOS Project funded in frame of PL-POIR4.2
|
||
|
% --------------
|
||
|
%
|
||
|
function [varargout] = extractColumns(catalog, varargin)
|
||
|
for i=1:length(varargin)
|
||
|
colName = varargin{i};
|
||
|
varargout{i} = findColumn(catalog, colName);
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function column = findColumn(catalog, colName)
|
||
|
for c=1:length(catalog)
|
||
|
if strcmp(catalog(c).field, colName)
|
||
|
column = catalog(c).val;
|
||
|
break;
|
||
|
end
|
||
|
end
|
||
|
if exist('column') ~= 1
|
||
|
error('no column named %s', colName);
|
||
|
end
|
||
|
end
|