Hello,
I have a Data table using 9 variables. I want to create new one (Age) using previous column(rings) +1.
how can i do this ? please help.
thank you

 채택된 답변

Guillaume
Guillaume 2019년 10월 23일

0 개 추천

yourtable.Age = yourtable.Rings + 1.5;
by the sound of it. If not, then attach an example of your data as a mat file.

추가 답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 10월 23일
편집: KALYAN ACHARJYA 2019년 10월 23일

0 개 추천

-How to add another column-
In the followig sample code, I have added New_col here
load patients %data file with Matlab
New_col=(1:100)'; %I have added this New_col data as new column in the table
result=table(Age,Gender,Height,New_col)
Hope it helps!

댓글 수: 4

kav
kav 2019년 10월 23일
thank u for your answer.
but i want to create new column Age with previous column Rings values +1.5.
so my Age column values will be 16.5 8.5 ........
Rings Age= Rings +1.5
15
7
9
10
7
Here I have shown as you want
load patients %data file with Matlab
%New Column=Height+15, here Height is the one column in the table
New_col=Height+1.5; %I have added this New_col data as new column in the table
result=table(Age,Gender,Height,New_col)
kav
kav 2019년 10월 23일
yes got it thank you!
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 10월 23일
Welcome!

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

질문:

kav
2019년 10월 23일

댓글:

2019년 10월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by