Attached the testfile if anyone wants to play around what im after :(
how to view content of my cell table
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi there can anyone help me figure out how to show the content of my table? this is the code I have at the moment and I also attached my results
%--FIND NaN ROWS THEN DELETE ENTIRE ROW
PCBAllDataSet = readtable('testfile5.csv');
%imports the only columns needed
PCBRequiredCol = PCBAllDataSet(:,{'PcbTestID','PcbID','Verify12VInput','VerifyCurrentDraw'});
%remove row that contains NaN value
PCBRemoveNaNRow = rmmissing(PCBRequiredCol);
%--REMOVE ROW DUPLICATIONS
%create another table for keyset and valueset
%duplications will be removed as the table is made
newTable = containers.Map('KeyType','char','ValueType','any');
%forloop to assign key and value set on every row
for i = 1:size(PCBRemoveNaNRow,1)
keyID = char(table2cell(PCBRemoveNaNRow(i,2)));
%current(i) row, 3rd column to end column
valueSet = PCBRemoveNaNRow(i,3:end);
newTable(keyID) = valueSet;
disp(newTable)
end
%creates the table
bigTable = table(newTable.values);
splittingColumns = splitvars(bigTable)
HERE ARE MY RESULTS:
bigTable =
table
Var1
_________________________________________
[1×2 table] [1×2 table] [1×2 table]
splittingColumns
splittingColumns =
1×3 table
Var1_1 Var1_2 Var1_3
___________ ___________ ___________
[1×2 table] [1×2 table] [1×2 table]
It keeps coming up with a [1x2 table] but I want too be able to look at the value/content of whats inside that two column. Can anyone please suggest something?
Réponse acceptée
Luna
le 11 Jan 2019
Try this in the last section:
%creates the table
temp = newTable.values;
bigTable = [];
for i = 1:numel(temp)
bigTable = [bigTable; temp{i}];
end
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Tables dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!