Fix Erorr using cellstr.

Hi z='20' {1×2 cell} :eror : input must be a string . How do I fix this error?

7 comentarios

chicken vector
chicken vector el 20 de Abr. de 2023
Share your code to allow other users to help you and read this before re-posting.
Ali Nik
Ali Nik el 20 de Abr. de 2023
Editada: Ali Nik el 20 de Abr. de 2023
for j=2:length(Y)
if length(Y{1,j})~=1
z=Y{1,j}
zz=cellstr(z)
Dyuman Joshi
Dyuman Joshi el 20 de Abr. de 2023
As the error clearly states, the input to cellstr() must be a string, which it is not.
What is the content of Y? Please attach the data corresponding to Y.
Ali Nik
Ali Nik el 20 de Abr. de 2023
Dyuman Joshi
Dyuman Joshi el 20 de Abr. de 2023
I assume you want to convert each cell into cell string (except the elements which are already a cell string)?
Ali Nik
Ali Nik el 20 de Abr. de 2023
Actually, I want to implement hierarchical clustering algorithm in MATLAB. Each character means the cluster name.
Ali Nik
Ali Nik el 20 de Abr. de 2023
Yes

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 20 de Abr. de 2023

Comentada:

el 20 de Abr. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by