Plot histograms from a loop

조회 수: 10 (최근 30일)
msij
msij 2016년 3월 2일
댓글: Giorgio Gerini Romagnoli 2020년 5월 14일
Hi,
I have a loop that reads in all images from a folder and then processes and analyses them. From this, I get n variables with certain values. I want to be able plot each of these variables as a histogram on the same plot (and have a different colour for each histogram).
So if I have 3 images, I want 3 histograms. If I have 5, then I want 5.
How would I go about doing this?
I tried a few loops but kept getting stuck.
Thanks for your help.

채택된 답변

Steven Lord
Steven Lord 2016년 3월 2일
There's an example on the documentation page for HISTOGRAM that shows how to plot multiple histograms on the same axes.
  댓글 수: 2
msij
msij 2016년 3월 3일
편집: msij 2016년 3월 3일
I know how to plot multiple histograms on the same axes.
What I'm asking here is how to do this from a loop with variable arguments.
If the input is 4 images, the resulting data is given in 4 variables. Then I need to plot all 4 on the same axes. However I'm not sure how to do this given a variable number of images each time.
EDIT: Never mind. I solved this issue by using a while loop. Thanks anyway.
Giorgio Gerini Romagnoli
Giorgio Gerini Romagnoli 2020년 5월 14일
Hello, I am trying to do the same here, how did you solve this issue?

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

추가 답변 (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