Error: Cannot convert double value 5 to a handle

Please help me fix the following code and avoid getting "Cannot convert double value 5 to a handle" error.
set(h,'userdata',[sch(ii,1) ii h])
while h is a 1×9 graphics array:
Line Line Line Line Line Line Line Text Text

 채택된 답변

Stephen23
Stephen23 2019년 3월 22일

1 개 추천

Most likely sch(ii,1), ii, and h are actually all different classes which cannot be concatenated together.
You could easily use a cell array for storing heterogeneous data types:
set(h,'userdata',{sch(ii,1),ii,h})

댓글 수: 1

S H
S H 2019년 3월 22일
Amazing. Thank you Stephen. Your solution solved the error.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

제품

질문:

S H
2019년 3월 22일

댓글:

S H
2019년 3월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by