matlab online how to reference file in folder at same directory
Show older comments
Hi,
I'm using Matlab online. In my Matlab drive i have a folder in the same directory that my main.m . The folder is callded "Test2" and inside is a csv file, named 'testeXPTO.csv'. My code in main.m is this:
fid=fopen('../Test2/testeXPTO.csv');
C = textscan(fid, '%s','delimiter', '\n');
The error is:
Error using textscan Invalid file identifier. Use fopen to generate a valid file identifier.
What is the code to relative reference a path of a file that is inside a folder in the same directory that my main.m in Matlab online.
Thanks Your Francisco
2 Comments
Please show us both the fid and msg values:
[fid,msg] = fopen('../Test2/testeXPTO.csv')
Francisco Correia
on 9 Jun 2017
Accepted Answer
More Answers (0)
Communities
More Answers in the Distance Learning Community
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!