MATLAB: How to plot intensity like this

intensityMATLABplot intensity

Pls help,
Thankyou

Best Answer

%Do the required operation (filtered as per your question) and plot (with " hold on" a statement) in the respective plot, your question having three plot in each graph.

I=imread('flower.jpg');
im_r=I(:,:,1);
im_g=I(:,:,2);
im_b=I(:,:,3);
subplot(311),plot(mean(im_r),'r','linewidth',2);
subplot(312),plot(mean(im_g),'g','linewidth',2);
subplot(313),plot(mean(im_b),'b','linewidth',2);