You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
figure(2); hold on;
for j = 1:length(fileNames)
x = readtable(fileNames{j}, 'Delimiter', '\t', 'ReadVariableNames', true);
plot(x.flowRate, x.pDrop, '-o')
end
tbCriteria = tbRaw(:, criteriaNames);
[tbUnique, ~, subs] = unique(tbCriteria, 'rows', 'sorted');
pDropMean = accumarray(subs, tbRaw.pDrop, [], @mean);
tbFinal = table(tbUnique, pDropMean);
% (NB: I made a function for this: “accumtable”)%% Show file lines
dbtype filename 1 - Shows first line of file
for i = [2 3 5 6 9 10 11 12 13 14]
for j = [5 10 15 30]
for k = [1 2 3]
tempRow = {i*j*k, i+j+k, i/j/k}; % CREATE NEW ROW: USE { }
tb = [tb; tempRow]; % APPEND TO TABLE: USE [ ; ]
end
end
end
Element by element
varfun(@(x) x ./ max(x), T);
Combine
varfun(@mean, T);
Combine with grouping on a column
B = varfun(func,A,'GroupingVariables','Var1')
Summarize table
summary(T);
Add units to table
T.Properties.VariableUnits = {‘mm’ ‘s’ ‘kg’};
Unique vs. FindGroups
% Take a criteria table
y = DataTable(:, groupingVars);
[uniqueTable, ~,ii] = unique(y);
[ii, uniqueTable] = findgroups(y); % these two functions give the same results