mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sw-plotting-tool.git
synced 2025-12-16 18:18:03 +00:00
Added CSV file support, scrolling to allow for more data, and implemented first row secs option.
This commit is contained in:
21
loadData.m
21
loadData.m
@@ -1,18 +1,31 @@
|
||||
function [dataListTable] = loadData(tdmsFileList)
|
||||
function [dataListTable] = loadData(tdmsFileList, csvFileList)
|
||||
|
||||
%Convert struct to cell for easy access
|
||||
tdmsFileList = struct2cell(tdmsFileList);
|
||||
|
||||
|
||||
if width(tdmsFileList) > 0
|
||||
path = tdmsFileList{2, 1};
|
||||
else
|
||||
path = csvFileList(1).folder;
|
||||
end
|
||||
|
||||
%load TDMS files
|
||||
for i = 1:width(tdmsFileList)
|
||||
|
||||
%Read files and save them as a table in a list
|
||||
data = tdmsread(strcat(tdmsFileList{2, i}, '\', tdmsFileList{1, i}));
|
||||
|
||||
data = tdmsread(strcat(path, '\', tdmsFileList{1, i}));
|
||||
%Take the table out of an 1x1 cell array and convert it in a cell array.
|
||||
dataListTable{i} = table2array(data{1,1});
|
||||
|
||||
end
|
||||
|
||||
%load CSV files
|
||||
for i = width(tdmsFileList) + 1: length(csvFileList) + width(tdmsFileList)
|
||||
|
||||
%Read CSV files
|
||||
dataListTable{i} = readmatrix(strcat(path, '\', csvFileList(i - width(tdmsFileList)).name));
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user