Problem with a function using rgb2ycbcr
I am trying to do a function using rgb2ycbcr. It converts the image, then shows it up and saves it, but when I call the function, this error appears:
"Subscript indices must either be real positive integers or logicals."
Here’s my code:
function x = rgb2yuv( x )
x = rgb2ycbcr(x)
imshow(x)
imwrite(x, ‘C:UsersaaaaDocumentsPDIAtividade1imagensx_rgb2yuv.jpg’, ‘jpg’)
end
What am I doing wrong?I am trying to do a function using rgb2ycbcr. It converts the image, then shows it up and saves it, but when I call the function, this error appears:
"Subscript indices must either be real positive integers or logicals."
Here’s my code:
function x = rgb2yuv( x )
x = rgb2ycbcr(x)
imshow(x)
imwrite(x, ‘C:UsersaaaaDocumentsPDIAtividade1imagensx_rgb2yuv.jpg’, ‘jpg’)
end
What am I doing wrong? I am trying to do a function using rgb2ycbcr. It converts the image, then shows it up and saves it, but when I call the function, this error appears:
"Subscript indices must either be real positive integers or logicals."
Here’s my code:
function x = rgb2yuv( x )
x = rgb2ycbcr(x)
imshow(x)
imwrite(x, ‘C:UsersaaaaDocumentsPDIAtividade1imagensx_rgb2yuv.jpg’, ‘jpg’)
end
What am I doing wrong? image, rgb, ycbcr, yuv, error, convert MATLAB Answers — New Questions