Fix Erorr using cellstr.

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

7 个评论

Share your code to allow other users to help you and read this before re-posting.
for j=2:length(Y)
if length(Y{1,j})~=1
z=Y{1,j}
zz=cellstr(z)
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.
I assume you want to convert each cell into cell string (except the elements which are already a cell string)?
Actually, I want to implement hierarchical clustering algorithm in MATLAB. Each character means the cluster name.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Characters and Strings 的更多信息

提问:

2023-4-20

评论:

2023-4-20

Community Treasure Hunt

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

Start Hunting!

Translated by