Having trouble using the histogram function

조회 수: 1 (최근 30일)
Supriya Prasad
Supriya Prasad 2019년 7월 24일
댓글: Supriya Prasad 2019년 7월 25일
I have been trying to generate a histogram of gradients for an input image. The image is given to a function, which then finally returns a column vector X. However, when I say histogram(X), I get the following error:
>> histogram(x)
Not enough input arguments.
Error in histogram (line 27)
binSize = pi / numBins;
line 27 is
% Compute the bin size in radians. 180 degress = pi.
binSize = pi / numBins;
I have even tried copying and running the example histogram codes on the documentation page, but all return the exact same error. I'm pretty sure they should work without me having to give any input arguments. Please let me know what I'm missing, I know it must be something pretty silly.
  댓글 수: 2
Adam Danz
Adam Danz 2019년 7월 24일
편집: Adam Danz 2019년 7월 24일
1) What version of matlab are you using? (run ver() if you don't know).
2) can you share your column vector (or at least part of it)?
[edit]
3) see Steven Lord's answer - my money's on that.
Supriya Prasad
Supriya Prasad 2019년 7월 25일
Thank you for your help!

댓글을 달려면 로그인하십시오.

채택된 답변

Steven Lord
Steven Lord 2019년 7월 24일
Are you calling the histogram function included in MATLAB, one that you wrote, one that you downloaded from somewhere, or one someone gave you? To check this use the which function.
which -all histogram
I don't think the code you posted is part of the histogram function included in MATLAB. If that which command shows one that is outside the matlabroot directory, rename or remove it.
  댓글 수: 1
Supriya Prasad
Supriya Prasad 2019년 7월 25일
Thank you so much! You're right, unfortunately I'd named another file in the same directory as histogram.m :) Lesson learned, thanks again!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by