- Convert each column of intrest to an array of strings. sCol1 =strings(T.hod)
- Concatenate all the strings arrays using the + operator T.ID = sCol1 + sCol2+ sCol3
write number next to each other + return value 0/1
3 次查看(过去 30 天)
显示 更早的评论
Hello,
i have a tablehave imported from Excel.
In the ID column I want the values from hod + min + s + CasVSekundach but as text so that it doesn't add up for me (T.ID = (T.hod) + (T.min) + (T.s). It should look like in the first column: not 25 but 002525(h/min/s/CasVSekundach).
And I want to create a new column (ID_H), where the distance from the column according to criterion> 5 returns 0 and if = <5 returns 1
I try ID_H=(ID(ID>5)=1), but it doesn´t works...
Thank you for any help.
1 个评论
ILoveMATLAB
2022-6-14
编辑:ILoveMATLAB
2022-6-15
For your first question.
For your second question
ID_H = double(ID>5);
采纳的回答
Jon
2022-6-14
Let us say your table is called T, then you can use:
T.ID = string(T.hod) + string(T.min) + string(T.s) + string(CasVSekundach)
更多回答(1 个)
ILoveMATLAB
2022-6-15
编辑:ILoveMATLAB
2022-6-15
(Forgot to submit as an anwser)
For your first question.
- Convert each column of interest to an array of strings. sCol1 =strings(T.hod)
- Concatenate all the strings arrays using the + operator T.ID = sCol1 + sCol2+ sCol3
For your second question
ID_H = double(ID>5);
4 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!