Error using zeros CLASSNAME input must be a valid numeric or logical class name.

I try to draw line on image. in this code mat = zeros(250, 250, 'unit8'), they show this error Error using zeros CLASSNAME input must be a valid numeric or logical class name. I use matlab2017a.

1 件のコメント

Stephen23
Stephen23 2017 年 12 月 18 日
Read the error message. It tells you what the problem is. Did you check the class name?

サインインしてコメントする。

 採用された回答

その他の回答 (1 件)

Karthik Bhogi
Karthik Bhogi 2020 年 5 月 3 日

0 投票

@Joe Joe
in your code mat= zeros(250, 250, 'unit8')
please remove that unit 8 term and the code will run without any errors.

1 件のコメント

Karthik Bhogi
Karthik Bhogi 2020 年 5 月 3 日
編集済み: Karthik Bhogi 2020 年 5 月 3 日
you can also use 'single' or 'double' in place of 'unit8' to run your code without any errors.

サインインしてコメントする。

カテゴリ

タグ

質問済み:

2017 年 12 月 18 日

編集済み:

2020 年 5 月 3 日

Community Treasure Hunt

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

Start Hunting!