I have a matlab script that converts the images from png to jpeg. However when the new image is produced, it is named : pic.png with the jpeg extension. I want it to be pic with the jpeg extension.
Here is my script :
files = dir('*.png');
for k = 1:numel(files)
rgb = imread(files(k).name);
imwrite(rgb,[files(k).name '.jpeg'],'jpeg','Quality',50);
end
Any idea ?
Thanks
Use
filepartsto remove the extension: