MATLAB: RGB to Lab color space

color spacelabrgb

I want to converte RGB values to Lab, I read that conversion goes between XYZ color space. Ofcourse, I find directly alghorithm in Matlab
labTransformation = makecform('srgb2lab');
labI = applycform(image,labTransformation);
l = labI(:,:,1);
a = labI(:,:,2);
b = labI(:,:,3);
but it shows me values between 0-255 and I need standard values for Lab, L=0-100, a,b=-127+128. Because later I want calculate C and H with a, b values.
Thanks.

Best Answer

Just using
lab = rgb2lab(rgb);
seems to give results in the expected output range. I'm not sure what all the extra work of creating a colour transform gives you, even if it did give the answer you want.