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

댓글 수: 7

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

댓글을 달려면 로그인하십시오.

답변 (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