How to concatenate string cell arrays?
4 次查看(过去 30 天)
显示 更早的评论
I have 2 string cells arrays (a 1 X 191 cell array and a 5 X 1 cell array). How can I concatenate the two so I have a 955 X 1 cell array that starts with Raw intensity mean (191 times), Gray mean ws=3 mean (191 times), etc. for all 191 cells.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/423663/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/423668/image.png)
0 个评论
回答(1 个)
Abdolkarim Mohammadi
2020-11-22
What you need is the Cartesian product of the two sets. MATLAB does not have built-in function, but there are several functions on FEX.
2 个评论
Abdolkarim Mohammadi
2020-11-22
编辑:Abdolkarim Mohammadi
2020-11-22
You can have it work for strings by editing the function. For example, you change
X = zeros (...);
to
X = strings (...);
I think no other change is needed. Or you can use another FEX function.
As I mentioned, there are several functions for this on FEX. You can get them by googling "matlab cartesian product".
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!