Unrecognized function or variable 'bins'.

I am workiong on a lab and when I run the command:
[~,R] = imnoise2(ones(100000,1),'gaussian',0,1);
hist(R, bins);
As instucted I get the error
Unrecognized function or variable 'bins'.
Error in Part6 (line 2)
hist(R, bins)
Any idea why?

답변 (1개)

Image Analyst
Image Analyst 2020년 12월 10일

0 개 추천

Because you never assigned any number to bins. Try
[~,R] = imnoise2(ones(100000,1),'gaussian',0,1);
bins = 256;
hist(R, bins);
or
[~,R] = imnoise2(ones(100000,1),'gaussian',0,1);
imhist(R);
or
[~,R] = imnoise2(ones(100000,1),'gaussian',0,1);
histogram(R, 256);

카테고리

도움말 센터File Exchange에서 Histograms에 대해 자세히 알아보기

질문:

2020년 12월 10일

답변:

2020년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by