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 件)

カテゴリ

製品

質問済み:

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