问题
I have a cell array sized 14676x117 call myCellArray
.
I want to extract values stored in myCellArray{2:14676,1}
in an string array. runnning below script only returns a single string value and do not return an string array.
>> y= myCellArray{2:14676,1}
y =
"test1"
How can I convert this cell array range to and string array?
回答1:
Try:
y = string(myCellArray{2:14675, 1})
If you have MATLAB 2016b or newer, this should work.
Source: Create String Arrays
回答2:
Use char command:
c = char(myCellArray(2:14675, 1))
来源:https://stackoverflow.com/questions/52805061/matlab-how-to-convert-cell-array-to-string-array