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 CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by