How do I specify the cell array to indicate strings in double quotation?
3 次查看(过去 30 天)
显示 更早的评论
I have an array of strings (pulled from Excel column headers).
For example,
A{1,1} = 'Station Number'
A{1,2} = 'Depth'
etc.
How do I specify the array, so that the output is (please note the double quotation)'
"Station Number"
"Depth"
etc.
The reason I want double quotation is to use the newline function.
Thank you.
0 个评论
采纳的回答
Star Strider
2019-4-12
A{1,1} = 'Station Number'
A{1,2} = 'Depth'
A = string(A)
producing:
A =
1×2 cell array
{'Station Number'} {'Depth'}
A =
1×2 string array
"Station Number" "Depth"
So ‘A’ begins as a cell array and after the conversion becomes a string array.
Is that what you want to do?
7 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Identification 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!