|
1 | | -function outputFiltered = readAndFilterLogfile(filterHeader, filterContent, varargin) |
| 1 | +function outputFiltered = readAndFilterLogfile(columnName, filterBy, varargin) |
2 | 2 | % outputFiltered = readOutputFilter(filterHeader, filterContent, varargin) |
3 | 3 | % |
4 | 4 | % It will display in the command window the content of the `output.tsv' filtered by one element |
|
9 | 9 | % |
10 | 10 | % INPUT: |
11 | 11 | % |
12 | | - % - filterHeader: string, the header of the column where the content of insterest is stored |
| 12 | + % - columnName: string, the header of the column where the content of insterest is stored |
13 | 13 | % (e.g., for 'trigger' will be 'trial type') |
14 | | - % - filterContent: string, the content of the column you want to filter out. It can take just |
| 14 | + % - filterBy: string, the content of the column you want to filter out. It can take just |
15 | 15 | % part of the content name (e.g., you want to display the triggers and you have |
16 | 16 | % 'trigger_motion' and 'trigger_static', 'trigger' as input will do) |
17 | 17 | % - varargin: either cfg (to display the last run output) or the file path as string |
|
39 | 39 | output = bids.util.tsvread(tsvFile); |
40 | 40 |
|
41 | 41 | % Get the index of the target contentent to filter and display |
42 | | - filterIdx = find(strncmp(output.(filterHeader), filterContent, length(filterContent))); |
| 42 | + filterIdx = find(strncmp(output.(columnName), filterBy, length(filterBy))); |
43 | 43 |
|
44 | 44 | % Convert the structure to dataset |
45 | 45 | outputDataset = struct2dataset(output); |
|
0 commit comments