フィルターのクリア

How do you convert the content of one cell of a character/cell array to a string?

1 回表示 (過去 30 日間)
How do you convert the content of one cell of a character/cell array to a string?
  1 件のコメント
Stephen23
Stephen23 2018 年 5 月 8 日
@Eliah Verbeemen: what is in that cell? What class? What size?

サインインしてコメントする。

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 5 月 8 日
編集済み: Ameer Hamza 2018 年 5 月 8 日
string(cellArray);
To combine them all in one string use
strjoin(cellArray)
  4 件のコメント
Eliah Verbeemen
Eliah Verbeemen 2018 年 5 月 8 日
I found a very unhandy possibility filelines2 = strsplit(filecontent, 'word that one search'); [OO,OOO]= size(filelines2); if OOO>1 (the word is present)
Guillaume
Guillaume 2018 年 5 月 8 日
@eliah,
You seem to be using very imprecise terms to describe the type of your data. A structure array has a very precise meaning in matlab. So does cell array. They're two very different types and also completely different from what is shown in you screenshot, a char array.
Someone of you proposed: NumberOfCell=find(cellfun(@strcmp,...
That's very convoluted. It is very likely that a simple regexp is all that is needed but more details needed on the input and desired output.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by