fopen fails to open the file

Hi there,
small example file (test.m):
if true
clear all; clc;
disp(fopen('C:/test/test.csv'));
disp(fopen('test.csv'));
end
my current directory is also C:/test/ and the file (test.csv) exits as well.
but still both lines of code return the value -1 which indicates that the file couldn't be found and I don't know why.
Any hint?

 Accepted Answer

Sean de Wolski
Sean de Wolski on 10 Sep 2012
Is test.csv opened in another application?

1 Comment

awwww man, so stupid -.- *facepalm
many thanks

Sign in to comment.

More Answers (1)

[fid, message] = fopen('test.csv');
if fid < 0; disp(message); end

Categories

Community Treasure Hunt

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

Start Hunting!