CAPTAIN Toolbox - fwrite problem
5 views (last 30 days)
Show older comments
Hi, I am trying to run the dlrdemo from CAPTAIN Toolbox but encountered a fwrite problem. I have ensured that the directory has "write" access but don't know what else is wrong. Any help or advise you could provide will be much appreciated.
nvr=dlropt(y, z, TVP)
??? Error using ==> fwrite
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in ==> C:\captain\captreg.p>captreg at 153
Error in ==> C:\captain\kalmsmo.p>kalmsmo at 47
Error in ==> C:\captain\dlrfun.p>dlrfun at 89
Error in ==> fminsearch at 205
fv(:,1) = funfcn(x,varargin{:});
Error in ==> C:\captain\dlropt.p>dlropt at 312
Error in ==> dlrdemo at 59
nvr=dlropt(y, z, TVP)
??? Error while evaluating uicontrol Callback
I have ensured that the directory is writable
attrib -r +s c:\captain
1 Comment
Oleg Komarov
on 9 Aug 2011
Please format your code/error message: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup#answer_18099
Accepted Answer
dbstop
on 5 Aug 2012
Hi there,
I just ran into the same problem. The trouble is that on Windows machines the toolbox attempts to write 2 configuration files directly into the Windows folder (matlabrf.ini and ctfst20.ini). For good reasons administrators often deny ordinary users write access to this folder, which leads to failure of fopen() which is NOT captured within the toolbox code. Naturally fwrite() fails subsequently causing the error.
Fix it by giving sufficient writing privileges to your user. Removing these rights again after a first run seems to work well so far.
To the developers of the toolbox: Why don't you just put your configuration files in a better place? It would be much better programming style. Also capture fopen() errors in future versions of the toolbox.
Cheers
0 Comments
More Answers (1)
Rajiv Singh
on 9 Aug 2011
This is a third party product whose developers might not be watching MATLAB answers. You might have better luck reaching them through their website.
0 Comments
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!