error as input must be numeric

1 回表示 (過去 30 日間)
FIR
FIR 2011 年 11 月 9 日
回答済み: Prateekshya 2024 年 9 月 2 日
walter i get this error
Error using ==> hist at 45 Input arguments must be numeric.
Error in ==> gra at 24 hist(month);
as per your code
hist(month);
set(gca,'XLabel', GD);

回答 (1 件)

Prateekshya
Prateekshya 2024 年 9 月 2 日
Hello @FIR,
This error will occur when "month" is not numeric, since "hist" function expects a numeric argument. To resolve this error, you need to use a numeric data type as an argument of "hist" function.
You may also explore "histogram" function as an alternative. Please find the link for the documentation of "histogram": https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.histogram.html
I hope this helps!

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by