shared-snippets/matlab/export/extractGdfFields.m

16 lines
428 B
Matlab

%
% -----------------
% Copyright © 2020 ACK Cyfronet AGH, Poland.
%
% This work was partially funded by EPOS Project funded in frame of PL-POIR4.2
% --------------
%
function [varargout] = extractGdfFields(gdf, fieldNames)
for i = 1:length(fieldNames)
fieldName = fieldNames{i};
assert(isfield(gdf.d, fieldName), ['gdf has no field with name: ' fieldName])
varargout{i} = getfield(gdf.d, fieldName);
end
end