Not able to delete "pitcntrl.plt"

I was able to successfully run FAST using Simulink interface (sample files). After the run is completed, ‘pitcntrl.plt’ is created along with few other files. I’m trying to delete ‘pitcntrl.plt’ but not able to do so. Because it says "Unable to delete file: “…\pitcntrl.plt” because it is being used by MATLAB.
I tried “fclose(‘all’)” in Matalb, it returned “zero” indicating successful operation. Even then not able to delete “pitcntrl.plt”. Google search shown some memory leak issue fix in 2002 by Jonkman. Because of this, everytime i’ve to close matlab and re-open.

When i try to run the same simulation again (w/o deleting the pitcntrl.plt) file, run exits with the below message.
OpenFOutFile:Cannot open file “pitcntrl.plt”. Another program like MS Excel may have locked it
for writing.

I’m using Matlab R2015b.
Appreciate any help in this regard.


Dear Kumara,

Until your post, I was previously unaware of output file “pitcntrl.plt”. Looking at the source code, it appears that “pitcntrl.plt” is a debug file written by Craig Hansen’s user-defined pitch-control routine if the DebugFlag is enabled in the “pitch.ipt” file. I would normally not expect that you’d user Craig Hansen’s user-defined pitch controller if you are running FAST using the Simulink interface. Regardless, you can prevent FAST from generating a “pitcntrl.plt” file by disabling the DebugFlag in the “pitch.ipt” file i.e. by setting CNST(11) = 0.

Best regards,

Dear Jason,

Your suggestion worked. Thank you!