how to convert a cell to string in matlab

后端 未结 4 513
夕颜
夕颜 2021-02-01 06:53

Suppose I have a cell

v =    \'v\'    [576.5818]    [3.0286]    [576.9270]

       \'v\'    [576.5953]    [3.1180]    [576.8716]

       \'f\'    [      56]    [         


        
4条回答
  •  梦毁少年i
    2021-02-01 07:11

    Suppose we have a cell as follows:

    my_cell = {'Hello World'}  
    class(my_cell)
    ans = 
    cell
    

    We can get the string out of it simply by using the {:} operator on it directly.

       class(my_cell{:})
        ans =
        char
    

    Note that we can use the expression mycell{:} anywhere we would use a normal string.

提交回复
热议问题