フィルターのクリア

Error using load Unable to read file 'templates'. Input cannot be a directory. Error in main (line 75) load templates

6 ビュー (過去 30 日間)
Praveen  kumar
Praveen kumar 2016 年 3 月 17 日
編集済み: Ced 2016 年 3 月 17 日
plz help me i am not knowing what to do.this error is occurring..i had the templates file in my matlab folder.

回答 (1 件)

Ced
Ced 2016 年 3 月 17 日
編集済み: Ced 2016 年 3 月 17 日
Hi
This is what the error says:
In your script in line 75, you are trying to load "templates". You also have a directory called "templates". This confuses matlab, which tells you that it cannot "load" a directory.
Try to include the file extension when you call "load", i.e.
load('templates.txt')
or whatever it is you are loading.
I would generally suggest to use more expressive names for files and functions in Matlab than "main" or "templates". Unless you keep adding and removing files from the matlab path, this is bound to give you conflicts.
  1 件のコメント
Ced
Ced 2016 年 3 月 17 日
編集済み: Ced 2016 年 3 月 17 日
Try this:
Create two files.
File 1: file_loading_test.m with the following content:
filename = 'data_testfile.txt';
A = load(filename)
File 2: data_testfile.txt with the following content:
1 2 3
Make sure you are in the same folder as the two files, then run the "file_loading_test.m" script.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by