| OLD | NEW |
| 1 function parsed = parseLog(filename) | 1 function parsed = parseLog(filename) |
| 2 % | 2 % |
| 3 % parsed = parseLog(filename) | 3 % parsed = parseLog(filename) |
| 4 % Parses a DataLog text file, with the filename specified in the string | 4 % Parses a DataLog text file, with the filename specified in the string |
| 5 % filename, into a struct with each column name as a field, and with the | 5 % filename, into a struct with each column name as a field, and with the |
| 6 % column data stored as a vector in that field. | 6 % column data stored as a vector in that field. |
| 7 % | 7 % |
| 8 % Arguments | 8 % Arguments |
| 9 % | 9 % |
| 10 % filename: A string with the name of the file to parse. | 10 % filename: A string with the name of the file to parse. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 parsed.(strrep(m{1}{1}, ' ', '_')) = table.data(:, i:i+n); | 45 parsed.(strrep(m{1}{1}, ' ', '_')) = table.data(:, i:i+n); |
| 46 i = i + n + 1; | 46 i = i + n + 1; |
| 47 elseif ~isempty(colheaders{i}) | 47 elseif ~isempty(colheaders{i}) |
| 48 % Parse a single-value column | 48 % Parse a single-value column |
| 49 parsed.(strrep(colheaders{i}, ' ', '_')) = table.data(:, i); | 49 parsed.(strrep(colheaders{i}, ' ', '_')) = table.data(:, i); |
| 50 i = i + 1; | 50 i = i + 1; |
| 51 else | 51 else |
| 52 error('Empty column'); | 52 error('Empty column'); |
| 53 end | 53 end |
| 54 end | 54 end |
| OLD | NEW |