Naming Table Variables of a File
21 views (last 30 days)
Show older comments
Fatih
on 27 Sep 2025 at 19:02
Commented: Fatih
on 27 Sep 2025 at 19:58
I have a table 3x1 where each value has 6 seperate values. I want to name these 6 column names. As shown in the attached screenshot, I want to name 1 for example Data1, 2 Data2 etc.
Thanks for help in advance.

0 Comments
Accepted Answer
Torsten
on 27 Sep 2025 at 19:26
Edited: Torsten
on 27 Sep 2025 at 19:31
load("T.mat")
T1 = splitvars(T);
T1 = renamevars(T1,["rows_1" "rows_2" "rows_3" "rows_4" "rows_5" "rows_6"],...
["Data1" "Data2" "Data3" "Data4" "Data5" "Data6"])
Alternatively:
T2 = renamevars(T,["rows"],["Data"]);
T2 = splitvars(T2)
More Answers (0)
See Also
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!