Convert Logical Column to Table
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Theodore
am 11 Mär. 2023
Beantwortet: Star Strider
am 11 Mär. 2023
How does one append a Nx1 logical to the right of a Nx4 table?
I assumed this would be a matter of horzcat(initialTable, logicalColumn)
But, I recieve an error of "All input arguments must be tables."
So the real question is:
how to convert the Nx1 logical column to a "table", such that I can horzcat the tables?
Thank you
0 Kommentare
Akzeptierte Antwort
Star Strider
am 11 Mär. 2023
T1 = array2table(rand(10,4), 'VariableNames',{'A','B','C','D'})
LogicalVector = rand(10,1)>0.5;
T1 = addvars(T1,LogicalVector,'After','D')
.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Tables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!