lambda = 400:700;
I_of_lambda =
rgb_of_lambda =
C_of_lambda = ones(size(lambda));
a=10e3;
x=linspace(-0.2,0.2,1000);
y=x;
[X,Y]=meshgrid(x,y);
r=sqrt(X.^2+Y.^2);
Img_rgb = zeros([size(X),3]);
for i_lambda = 1:numel(lambda)
u=2.*pi.*a./lambda(i_lambda);
J=besselj(1,u.*sin(r));
I=sqrt((u.*((1+cos(r))./2).*(J./sin(r))).^2);
Img_rgb(:,:,1) = Img_rgb(:,:,1) + I*rgb_of_lambda(i_lambda,1)*C_of_lambda(i_lambda);
Img_rgb(:,:,2) = Img_rgb(:,:,2) + I*rgb_of_lambda(i_lambda,2)*C_of_lambda(i_lambda);
Img_rgb(:,:,3) = Img_rgb(:,:,3) + I*rgb_of_lambda(i_lambda,3)*C_of_lambda(i_lambda);
end
Img_rgb = Img_rgb/max(Img_rgb(:));
imagesc(X(1,:),Y(:,1),Img_rgb); shading flat; axis image; title('4000 - 7000 Å');
4 Comments
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/677193-how-to-control-color-and-the-intensity-in-a-pcolor-figure#comment_1181978
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/677193-how-to-control-color-and-the-intensity-in-a-pcolor-figure#comment_1181978
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/677193-how-to-control-color-and-the-intensity-in-a-pcolor-figure#comment_1182013
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/677193-how-to-control-color-and-the-intensity-in-a-pcolor-figure#comment_1182013
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/677193-how-to-control-color-and-the-intensity-in-a-pcolor-figure#comment_1182433
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/677193-how-to-control-color-and-the-intensity-in-a-pcolor-figure#comment_1182433
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/677193-how-to-control-color-and-the-intensity-in-a-pcolor-figure#comment_1182968
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/677193-how-to-control-color-and-the-intensity-in-a-pcolor-figure#comment_1182968
Sign in to comment.