対数計算時のエラー
1 view (last 30 days)
Show older comments
画像の画素値に対して対数計算を行いたいのですが下記のようなエラーメッセージが表示されます。何がいけないのでしょうか。
>> logca1 = log(ca1)
関数 'log' の呼び出し内に、不足している引数または正しくない引数データ型がないかを確認してください
2 Comments
Accepted Answer
stozaki
on 17 Sep 2020
Edited: stozaki
on 17 Sep 2020
坂本様
コマンドの実行ありがとうございました。
ca1のクラスが "int16"となっています。log関数のドキュメントを見ると、入力引数のデータ型は "single" もしくは "double" となっています。従って、"int16"のデータ型は受け付けないという仕様です。
回避策としては、singleもしくはdoubleにキャストする方法は如何でしょうか?
logca1 = log(double(ca1))
どうぞ、ご検討ください。
stozaki
More Answers (0)
See Also
Categories
Find more on Downloads in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!