Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
imwrite error

Subject: imwrite error

From: Gerard

Date: 16 Jun, 2010 14:04:04

Message: 1 of 2

this error is fairly new and pops up in xp and win7. I have a loop that processes a number of files and on random files i get a message :
??? Error using ==> imwrite at 453
Can't open file "C:\Users\gerard\Desktop\6-15-2010\45 gain=2 pF\Corrected sequence
of object 30C.tif" for writing.
You may not have write permission.

some work some do not, they are all named the same way. If i go into the section of code that does the writing and copy and paste that section it works but it part of a bigger loop so i cant really continue without restarting. i thought it got better when i put a pause(5) before the actually loop that does the writing to the disk.
the section of code that fails looks like
 for zz=1:50
         temptemp=uint16(mid_nucd(:,:,zz));
         imwrite(temptemp',g_pathstring,'WriteMode','append','Compression','none');
    end

Any ideas would be appreciated. i have used this same program hundreds of times, and this is just something new that has been happening, using 2010a, it might not have happened under 2009b.

Subject: imwrite error

From: Rob Campbell

Date: 16 Jun, 2010 14:23:04

Message: 2 of 2


> Any ideas would be appreciated. i have used this same program hundreds of times, and this is just something new that has been happening, using 2010a, it might not have happened under 2009b.

It's a long shot, but maybe the errors you're getting are related to the file name being unsuitable.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us