How can I clear an entire table column without deleting the variable?
Ältere Kommentare anzeigen
I have the following table and want to clear the variable P without deleting the variable. Is there a way how I can do that or should I just delete the variable by using removevars and add new data by 'new' variable P.
P Type Date
0,43008 'Feeder' '21.05.2018'
0,03786 'Feeder' '21.05.2018'
0,37238 'Loader' '21.05.2018'
...
(288x4 table)
Thanks in advance!
1 Kommentar
Stephen23
am 23 Mai 2018
@s.h.m_89: what do "cleared" numeric values look like? What value/s would they have?
Akzeptierte Antwort
Weitere Antworten (1)
sloppydisk
am 23 Mai 2018
You can simply overwrite the values by indexing with curly braces if that is what you want
t = table(rand(6, 1), rand(6, 1), rand(6, 1))
t{:, 1} = (1:6)';
4 Kommentare
s.h.m_89
am 24 Mai 2018
Jeff Miller
am 25 Mai 2018
Do they really have to be missing? If not, maybe you could fill the column with NaN's and check for those instead of checking for missing. Or fill with a character and check for nonnumeric, etc.
Walter Roberson
am 28 Mai 2018
NaN is the indicator of Missing for numeric entries for the purposes of tables. https://www.mathworks.com/help/matlab/ref/ismissing.html
Kategorien
Mehr zu Tables finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!