how can I solve the problem of imwrite permission

13 visualizzazioni (ultimi 30 giorni)
Ess Ma
Ess Ma il 6 Apr 2022
Risposto: Hitesh il 4 Apr 2025
I am using the imwrite commant for writing the image but i have an error 'you might not have write permission'. How can I resolve it?
close all
x=imread('C:\Users\PC\Pictures\fishing boat','tif');
imshow(x)
imwrite(x,'fishing boat.tif')
  1 Commento
Simon Allosserie
Simon Allosserie il 6 Apr 2022
You are trying to write within your program files folder. Possibly you don't have admin rights and therefor are not allowed to write files there. Always first set your Current Folder in Matlab to a folder you have access and permission to. Files you write will end up in that folder. Try changing your current folder to a folder you do have access to.
If you want to write your file to a specific other folder, you can also use the full image address in imwrite() - just as you used the full address in imread()

Accedi per commentare.

Risposte (1)

Hitesh
Hitesh il 4 Apr 2025
Hi Ess Ma,
You need to add the current directory path to MATLAB path. The directory in which you were trying to write the image files requires to open the MATLAB with administrator permission. I am able to write it with opening the MATLAB with admin permission.

Categorie

Scopri di più su File Operations in Help Center e File Exchange

Prodotti


Release

R2012a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by