fopen fails to open the file
30 views (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
More Answers (1)
Walter Roberson
on 10 Sep 2012
[fid, message] = fopen('test.csv');
if fid < 0; disp(message); end
0 Comments
See Also
Categories
Find more on Low-Level File I/O 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!