Undefined function 'int' for input arguments of type 'double'.

6 ビュー (過去 30 日間)
Bellahoug
Bellahoug 2018 年 10 月 17 日
コメント済み: Bellahoug 2018 年 10 月 17 日
Hello. I've searched around for hours but I can't figure this out.
I have the toolbox, when I type `which` in matlab I get this:
:\Program Files\MATLAB\R2018a\toolbox\signal\signal\@filtstates\int.m % filtstates method.
This is just one part and its going in a loop, but I just posted to where the error occurs.
fruit = 2;
chocolate = 3;
max_price = 80.49;
min_price = 40.50;
max_fruit = int(max_price/fruit)
max_chocolate = int(max_price/chocolate)
Undefined function 'int' for input arguments of type 'double'.
What do i do?

採用された回答

Steven Lord
Steven Lord 2018 年 10 月 17 日
If you're trying to use the int function to turn the result of that division into an integer value, depending on how you want it rounded use the ceil, fix, floor, or round functions listed on this documentation page.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by