How I change the name of the variables in a table?

1 回表示 (過去 30 日間)
HelpAStudent
HelpAStudent 2022 年 5 月 15 日
編集済み: KALYAN ACHARJYA 2022 年 5 月 15 日
Hi! I have a table like that:
Movement_Table = table(Fetal_table.fetal_movement, Fetal_table_tot.r_prolongued_decelerations, Fetal_table_tot.r_prolongued_light_decelarations, Fetal_table_tot.r_prolongued_accelerations, Fetal_table_tot.r_uterine_contractionss)
How can I change the name of each Var?
Like Var1 renamed as 'Fetal Movement', Var2 as 'Prolongued Decelerations' and so on?
Thank you!

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2022 年 5 月 15 日
編集済み: KALYAN ACHARJYA 2022 年 5 月 15 日
Just load the table, for example -
var1=[1:10]';
var2=[11:20]';
T=table(var1,var2)
T = 10×2 table
var1 var2 ____ ____ 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10 20
% Change the Var names
T_new=renamevars(T,["var1","var2",], ["new_name1","new_name2"]);
T_new
T_new = 10×2 table
new_name1 new_name2 _________ _________ 1 11 2 12 3 13 4 14 5 15 6 16 7 17 8 18 9 19 10 20

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by