convert RGB image to HSV

Syntax

<object> = rgb2hsv(<image name>);

Example

>> A = imread('penguins.jpg');
>> B = rgb2hsv(A); % converting image to HSV
>> figure,
>> subplot(1,2,1);imshow(A);title('RGB Image');
>> subplot(1,2,2);imshow(B);title('HSV Image');

Output :