- "How do I create cycle in this case?"
Loop as discussed in below
- 2. "How do I count this average values and then build 3 plots?"
Lets say, R_plane,G_plane and B_plane are the R,G,B plane of RGB image (You mentioned: this part I completed successfully), Average
r_average=mean(R_plane(:));
g_average=mean(G_plane(:));
b_average=mean(B_plane(:));
For do the same of multiple images, you are advised the call images one by one and save the average values in array. To call the multiple images one by one and do operation, please see my this answer. for ..inside
r_average(i)=mean(R_plane(:));
g_average(i)=mean(G_plane(:));
b_average(i)=mean(B_plane(:));
end
Now
r_average, g_average, and b_average are three array, with size total number of images. Now you can do Bar plot (x images number and y as average number of corresponding image), outside the loop
r_average=[];
g_average=[];
b_average=[];
InputImages=...
for ..inside
r_average(i)=mean(R_plane(:));
g_average(i)=mean(G_plane(:));
b_average(i)=mean(B_plane(:));
end
subplot(131), bar(r_average);
subplot(132), bar(g_average);
subplot(133), bar(b_average);
or if you insisted to use plot
x_data=[1:length(InputImages)];
subplot(131), plot(x_data,r_average);
subplot(132), plot(x_data,g_average);
subplot(133), plot(x_data,b_average);
Hope I understand your question.
Good Luck!