Undefined function 'cell2str' for input arguments of type 'cell'.

4 vues (au cours des 30 derniers jours)
sermet
sermet le 18 Nov 2013
Commenté : Walter Roberson le 25 Déc 2018
str = {'this' 'is' 'a' 'test' 'of' 'cell' '2' 'str'};
str=cell2str(str)
Undefined function 'cell2str' for input arguments of type 'cell'
%I got this error.
%How can I transform any character of cell to strings?

Réponse acceptée

Doug Hull
Doug Hull le 18 Nov 2013
There is no command cell2str in core MATLAB.
  1 commentaire
Walter Roberson
Walter Roberson le 25 Déc 2018
And string objects did not exist in MATLAB until R2016b.

Connectez-vous pour commenter.

Plus de réponses (2)

Matt J
Matt J le 18 Nov 2013
Modifié(e) : Matt J le 18 Nov 2013
Perhaps you are thinking of
>> cell2mat(str)
ans =
thisisatestofcell2str
or maybe
>> char(str)
ans =
this
is
a
test
of
cell
2
str

Pascal Boulos
Pascal Boulos le 19 Oct 2018
>> join(str)
ans =
string
"this is a test of cell 2 str"
>> strjoin(str)
ans =
'this is a test of cell 2 str'
  1 commentaire
Walter Roberson
Walter Roberson le 25 Déc 2018
Note that string objects did not exist before R2016b.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by