From: Adam on
Hey,

I ran into this problem before, but cant remember if/how I solved it. Anyways, I'm overwriting a file (objfun.m) based on what the user inputs. I'm using:

fid=fopen('objfun.m','w');
A bunch complex parsing stuff hapens here....
fclose(fid);

Then the new contents of objfun.m are read and used in my program. The problem is objfun.m is not actually changed unless I manually open it. What happens is when I read objfun.m I still get the old contents. If I double click it (manually opening it),I see the new stuff is there. Now, by opening it, it has been changed and I can read the new contents. It's as if the file is not properly updated for some reason until it is manually opened. Is there way to fix this or a workaround?

Thanks
From: Adam on
Remembered the solution. I must use clear functions to update the contents. Thanks.