How to add labels to an array or table (after conversion from an array)
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
FW
el 29 de Mayo de 2019
Respondida: Akira Agata
el 29 de Mayo de 2019
I have an array of 2000 x 4 data points. I would like to add labels to the columns only. For example, Column 1 should be 'time/min', column 2 "FT_cor 15uL'", column 3 is 'time/min', and column 4 is "FT_cor 20uL'". I was trying to use array2table option but it apparently needs row labels as well. This was my syntax
CombinedArray=[Dataset_15uL, Dataset_20uL]; which is, say, 2000x4
colname= {'time/min'; 'FT_cor 15uL';'time/min'; 'FT_cor 20uL'};
Comb=array2table(CombinedArray,'VariableNames',colname);
The above syntax does not work (This is MATLAB 2017b). Thanks.
0 comentarios
Respuesta aceptada
Akira Agata
el 29 de Mayo de 2019
This is because some characters (such as '/' ) and white space ' ' are not allowed to use as variable names in table. Also, each variable name in one table should be unique. So, please revise the colname before making table Comb, like:
colname = {'time_min','FT_cor15uL','time_min2','FT_cor20uL'};
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!