MATLAB Answers


I am having this error. Could you help?

Billy Grizz さんによって質問されました 2019 年 7 月 9 日
最新アクティビティ Jan
さんによって コメントされました 2019 年 7 月 9 日
Error using fopen Unable to find file. Ensure file exists and path is valid.
Error in dlmread (line 120)
[fid, theMessage] = fopen(filename);
Error in Self_Mob_TTB_Code_7_9_19 (line 81)

  1 件のコメント

2019 年 7 月 9 日
Please post the complete line of code, which causes the error.

サインイン to comment.


2 件の回答

回答者: Jan
2019 年 7 月 9 日

The error message is clear: You provide a name, which is not an existing file. What is exactly hidden in the omitted rest of:
TTB=dlmread([data_ ... ?

  3 件のコメント

Billy Grizz 2019 年 7 月 9 日
I can's seem to find out what the name of the name is and what is missing. My key file matches the data files I am looking for and the paths seem to be correct. Any suggestions on how to get to the bottom of this?
Billy Grizz 2019 年 7 月 9 日
Is there a way to have it give me the name it can not find so I can trouble shoot more?
2019 年 7 月 9 日
@Billy: Use the debugger to examine problems. Type this in the command window:
dbstop if error
Then run the code again. When Matlab stops at the error, check the name of the file.
Actually I'd assume, that you can find the contents by reading the code, most of all this line:
TTB=dlmread([data_ ...
If you show us at least the complete line, a more precise suggestion might be possible.

サインイン to comment.

Star Strider
回答者: Star Strider
2019 年 7 月 9 日
編集済み: Star Strider
2019 年 7 月 9 日

It is likely better to use the fullfile function than to cd to the path.
I would define ‘keyfile’ as:
keyfile = fullfile(pathname, filename);
and completely remove the cd calls.
If you hare having problems finding the file, You will have to use the operating system to find it if it is not on your MATLAB search path. In Windows, this is the File Explorer utility.

  0 件のコメント

サインイン to comment.

Translated by