Attached the testfile if anyone wants to play around what im after :(
how to view content of my cell table
5 次查看(过去 30 天)
显示 更早的评论
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?
采纳的回答
Luna
2019-1-11
Try this in the last section:
%creates the table
temp = newTable.values;
bigTable = [];
for i = 1:numel(temp)
bigTable = [bigTable; temp{i}];
end
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!