I am trying to write a function in Matlab that takes an RGB image of class unit8 and double and converts it to a YCBCR image. The transformation formula is below.

I would be really thankful for any help of any kind.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s an Image Processing Toolbox function for that, if you have access to it: RGB2YCBCR
If you don’t have access to it, here’s how you can do the conversion yourself:
And here’s the image you get when you display
ycbcrImage: