In my cd X:\TMMV17\Post I have a text file by name "Wall_fric_1212.txt". I have previously been able to run a csvread as follows:
csvread('Wall_fric_1212.txt',5)
However csvread has suddenly started to output the following:
"Error using csvread (line 34) File not found."
I have tried "rehash path", "rehash" and "addpath 'X:\TMMV17\Post'". I have tried
csvread('X:\TMMV17\Post\Wall_fric_1212.txt',5)
I have also tried renaming files, moving files etc. No luck. If I run
which('Wall_fric_1212.txt')
X:\TMMV17\Post\Wall_fric_1212.txt.
What could the problem be? Thank you in advance for your help. Regards Lindblom Markus

댓글 수: 3

Walter Roberson
Walter Roberson 2015년 12월 7일
In your sample output you have a period after ".txt", with your string ending '.txt.' . Is that period present in the output of which() or is it something you accidentally put in when you posted?
Markus Lindblom
Markus Lindblom 2015년 12월 8일
편집: Markus Lindblom 2015년 12월 8일
Sorry that has accidentally been added while posting. However the output of which has now suddenly changed to "\\ad.liu.se\home\marli379\TMMV17\Post\Wall_fric_1212.txt". I've tried adding said path as well but without luck.
Markus Lindblom
Markus Lindblom 2015년 12월 8일
The problem has been solved temporarily by using Matlab 2012 instead of Matlab 2014. So if anyone has the same problem this might help you momentarily.

댓글을 달려면 로그인하십시오.

답변 (2개)

Guillaume
Guillaume 2015년 12월 8일

1 개 추천

Note that playing around with matlab path (using rehash, or addpath, or ...) is not going to help in any way with your problem. The matlab path only help matlabs finding m files, not text files which need to be either in the current directory (change with cd) or referred by their full path.
It looks like your X: drive is a mapping to a network folder. Possibly, the mapping (done by the OS, nothing to do with matlab) has been lost. In any case, you can use the UNC to refer to your file, so:
csvread('\\ad.liu.se\home\marli379\TMMV17\Post\Wall_fric_1212.txt', 5)

댓글 수: 1

Markus Lindblom
Markus Lindblom 2015년 12월 8일
Thank you for your answer. However said approach does not work. It says "File not found/does not exist" or alike.

댓글을 달려면 로그인하십시오.

Jan
Jan 2015년 12월 8일

0 개 추천

Use absolute file names in every case:
csvread('X:\TMMV17\Post\Wall_fric_1212.txt', 5)
callbacks of GUIs oder TIMERs can change the current folder during the processing, so never rely on relative path names.

댓글 수: 1

Markus Lindblom
Markus Lindblom 2015년 12월 8일
Thank you for your answer. However said approach does not work. It says "File not found/does not exist" or alike.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

질문:

2015년 12월 7일

댓글:

2015년 12월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by