Extract string from Categorical Variable in Matlab

时间:2015-09-01 21:19:46

标签: matlab

I have a matlab categorical variable T where referencing T(1) gets me a 1x1 categorical type with string 'Test' in it.

How would I convert this categorical variable directly back to a string so that I may use it in another function that takes a string as an input?

1 个答案:

答案 0 :(得分:2)

您可以使用char功能,该功能根据文档here用于:

  

char:转换为字符数组(字符串)

示例:

char(T(1))