forked from episodes-platform/shared-snippets
Add code snippets
This commit is contained in:
19
matlab/catalog/findCatalogColumn.m
Normal file
19
matlab/catalog/findCatalogColumn.m
Normal file
@@ -0,0 +1,19 @@
|
||||
%
|
||||
% -----------------
|
||||
% Copyright © 2022 ACK Cyfronet AGH, Poland.
|
||||
% --------------
|
||||
%
|
||||
% Returns index of the column with the specified colName within the given catalog
|
||||
%
|
||||
% TODO use this function in extractColumns.m
|
||||
function columnIdx = findCatalogColumn(catalog, colName)
|
||||
for c=1:length(catalog)
|
||||
if strcmp(catalog(c).field, colName)
|
||||
columnIdx = c;
|
||||
break;
|
||||
end
|
||||
end
|
||||
if exist('columnIdx') ~= 1
|
||||
error('no column named %s', colName);
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user