How to save an image in a folder automatically?
32 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need to save the output image into a folder named 'Plate' in path named Documents/MATLAB/Project/Plate. But, I get error if I do so.Can anyone helpme in rectifying it?I have attached my code and the error in it.Anyone please help me in rectifying it.
baseFileName = 'my new image.png'; % Whatever....
fullFileName = fullfile('Documents/MATLAB/Project/Plate', baseFileName);
imwrite(r, fullFileName);
Error is
Error using imwrite (line 474)
Unable to open file "Documents\MATLAB\Project\Plate\my new image.png" for writing. You might not have write permission.
Error in Shi_tomashi (line 134)
imwrite(r, fullFileName);
0 commentaires
Réponses (3)
KSSV
le 5 Fév 2019
Go the respective folder and check the permissions......you need to give permissions to the folder to write the data into the folder.
2 commentaires
samreen mughal
le 18 Juin 2019
Modifié(e) : samreen mughal
le 18 Juin 2019
baseFileName = sprintf('my new image.png'); % Whatever....
fullFileName = fullfile('Documents/MATLAB/Project/Plate', baseFileName);
imwrite(r, fullFileName);
r is your image, right?
if r is the image then,
just include "sprintf" command in your code for writing your file name.
0 commentaires
Rahul punk
le 2 Juin 2021
Modifié(e) : Rahul punk
le 3 Juin 2021
%read image test.jpg
tt= imshow(image) ;
%save your image other location with any name save desktop or any folder also
saveas(tt,'C:\Users\admin\Desktop\testimagesave.jpg') ;
1 commentaire
Voir également
Catégories
En savoir plus sur Import, Export, and Conversion dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!