How to concatenate string cell arrays?

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.

답변 (1개)

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020년 11월 22일

0 개 추천

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

Nandini Chatterjee
Nandini Chatterjee 2020년 11월 22일
I noticed how the inputs must be numerical vectors. Can I still use this?
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".

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

릴리스

R2019b

질문:

2020년 11월 22일

편집:

2020년 11월 22일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by