function XYZ = Lxy2XYZ(Lxy)
%Lxy is a nx3 matrix


%L=Y Luminance
%x chromaticity coordinate
%y chromaticity coordinate

% Compute 'z' chromaticity coordinate
z = ones(length(Lxy),1) - Lxy(:,2) - Lxy(:,3);
XYZ = zeros(size(Lxy));
% Compute 'XYZ' values
XYZ(:,1) = (Lxy(:,1) ./ Lxy(:,3)) .* Lxy(:,2); % X = (Y/y)x
XYZ(:,2) = Lxy(:,1);
XYZ(:,3) = (Lxy(:,1) ./ Lxy(:,3)) .* z;

end
