How to save in another folder under same name in another directory

조회 수: 1 (최근 30일)
Shing
Shing 2013년 1월 9일
Hi,
I opened my image in folder called experiment and did some image processing. I wish to save my edited image in another folder known as edited under the same name so that I will not overwrite my original image in the original folder.
image = imread('15.tif'); %read image
%%CODE FOR imageprocess
imwrite(15,'C:\Users\user\Desktop\experiment\edited','tif'); %save image
However, when I do so, I got this error instead.
Can't open file "C:\Users\user\Desktop\experiment\edited" for writing. You may not have write permission.
How can I overcome this problem? Thank you ! :)

채택된 답변

Jan
Jan 2013년 1월 9일
The error message tells you: "You may not have write permission." It is worth to read and consider the contents of Matlab's messages. They are except for a hand full of cases very helpful.
When you do not have write permissions, it is a solution to get them. Usually the local admin can modify the access permissions to this folder or remove the write lock to the file, if it is existing already.
  댓글 수: 2
Shing
Shing 2013년 1월 10일
I tried going to the properties of the file and unchecked the options of read-only permission while closing other windows that are using that file However, when I refresh the page, the read-only remains checked though I'm the local admin. Is there other way to solve this issue? Thanks alot !
Jan
Jan 2013년 1월 10일
Matlab's fileattrib can set write-permissions also. But it is surprising, that you can uncheck the write-protection without an error message but without success. As usual I'd suggest a restart of Windows...

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 1월 9일
Are you sure you don't already have the file open for some reason, like you popped it open in the Windows Image and Fax Viewer which may have put a lock on it?

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by