printstructfun.m 692 Bytes
Newer Older
Michaela Olson's avatar
Michaela Olson committed
1
function [outputArg1] = printstructfun(x,transverse_file)
2
%function previously contained in MicrobeJ_segmentation with the addition
Michaela Olson's avatar
Michaela Olson committed
3
4
5
6
7
8
9
10
11
12
13
14
%of a timing function that gives the time taken to process each drug at
%what is the longest section of the code 

 outputArg1 = structfun(@(y) ... %for each photo in bacteria
                        cellfun(@(z) ... %for each NAME_id in bacteria
                            transverse_file(strcmp(transverse_file.NAME_id, char(z)), :), ... %find rows of matching id in transverse
                        y.NAME_id, 'UniformOutput', false).', ...
                 x, 'UniformOutput', false);

fprintf('Processed a drug. Total time elapsed: %.2fs \n',toc)
end