why the histogram wont show in the wanted axes the code has no errors but it wont show
2 ビュー (過去 30 日間)
古いコメントを表示
0 件のコメント
採用された回答
Walter Roberson
2023 年 1 月 9 日
When you have no output variable for imhist() and you do not tell it which axes to display into, then it will call gca() to find the current axes. gca() will not look for axes whose handle visibility is turned off, but by default handle visibility is off for all uiaxes in app designer.
You need to either turn on handle visibility for the target axes and make it the current axes (not recommended), or else you have to pass the target axes to imhist (recommended)
2 件のコメント
その他の回答 (1 件)
Image Analyst
2022 年 12 月 23 日
DON'T use input for the name of a variable because it's already the name of a function that asks the user for a variable. Call it userInput or something. What does this show in the command window
whos a
I'd like to know if the badly-named "a" is actually a gray scale image, an RGB image, or a character array (string).
4 件のコメント
Image Analyst
2023 年 1 月 10 日
imshow() works on an image, not a histogram object or counts of pixels. Don't use imshow at all. If you want to see the histogram, just use imhist(o) by itself
imhist(o); % "o" is a horrible name for a variable!
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!