fopen fails to open the file
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?
Accepted Answer
More Answers (1)
Walter Roberson
on 10 Sep 2012
[fid, message] = fopen('test.csv');
if fid < 0; disp(message); end
Categories
Find more on Characters and Strings 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!