対数計算時のエラー
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
画像の画素値に対して対数計算を行いたいのですが下記のようなエラーメッセージが表示されます。何がいけないのでしょうか。
>> logca1 = log(ca1)
関数 'log' の呼び出し内に、不足している引数または正しくない引数データ型がないかを確認してください
2 commentaires
Réponse acceptée
stozaki
le 17 Sep 2020
Modifié(e) : stozaki
le 17 Sep 2020
坂本様
コマンドの実行ありがとうございました。
ca1のクラスが "int16"となっています。log関数のドキュメントを見ると、入力引数のデータ型は "single" もしくは "double" となっています。従って、"int16"のデータ型は受け付けないという仕様です。
回避策としては、singleもしくはdoubleにキャストする方法は如何でしょうか?
logca1 = log(double(ca1))
どうぞ、ご検討ください。
stozaki
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur イベント関数 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!