Problem in convert cell to string.

1 回表示 (過去 30 日間)
Ara
Ara 2015 年 1 月 7 日
コメント済み: Ara 2015 年 1 月 7 日
I have a cell show like this
% code
val =
title="
google
">
The value is 3*7 char. If I want to convert into string to be ---> title="google"> What can I do? I have found many solution but can't help for this one. Thank you.

採用された回答

Guillaume
Guillaume 2015 年 1 月 7 日
Possibly, this is what you want:
strjoin(cellstr(val), '')
  5 件のコメント
Guillaume
Guillaume 2015 年 1 月 7 日
In that case, my code works:
>> val = ['title="'
'google '
'"> '];
>> whos val
Name Size Bytes Class Attributes
val 3x7 42 char
>> strjoin(cellstr(val), '')
ans =
title="google">
Ara
Ara 2015 年 1 月 7 日
Thank you. It's work

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

その他の回答 (1 件)

Sean de Wolski
Sean de Wolski 2015 年 1 月 7 日
S = reshape(A',1,[])
No reason to convert to and from a cell.
  3 件のコメント
Sean de Wolski
Sean de Wolski 2015 年 1 月 7 日
編集済み: Sean de Wolski 2015 年 1 月 7 日
Ahh, I didn't realize cellstr implicitly calls deblank. Good to know!
Ara
Ara 2015 年 1 月 7 日
Thank you very much.

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

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by