concatenate 2 vectors as string
5 次查看(过去 30 天)
显示 更早的评论
I have 2 vectors
a = [87.46 85.38 85.99 85.49 88.56 85.67]
b = [0.16 1.97 2.38 2.38 1.63 1.81]
I wanted to save the values of a and b in a string cell as
{87.46±0.16, 85.38±1.97, 85.99±2.38, 85.49±2.38, 88.56±1.63, 85.67±1.81}
1 个评论
Stephen23
2022-10-12
编辑:Stephen23
2022-10-12
"I wanted to save the values of a and b in a string cell as"
The MATLAB documentation states "Avoid using cell arrays of strings. When you use cell arrays, you give up the performance advantages that come from using string arrays. "
You should use a string array, rather than a cell array of string scalars.
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!