Cannot find an exact (case-sensitive) match??

30 ビュー (過去 30 日間)
CHIYUAN
CHIYUAN 2013 年 10 月 8 日
コメント済み: Steven Lord 2021 年 1 月 13 日
I use Matlab2012b,and I want to use toolbox from power system analysis book.
I create a subdirectory, "power", where the MATLAB toolbox resides.I copy the book's toolbox files to c/program/matlab/r2010b/toolbox/power.
I open any file, but it occurs like the following error:
Cannot find an exact (case-sensitive) match for 'ChP1EX1.m'
The closest match is C:\Program Files\MATLAB\R2012b\toolbox\power\ChP1EX1.M
To change the file extension, cd to the file's folder, type: movefile ChP1EX1.M ChP1EX1.m_bad; movefile ChP1EX1.m_bad ChP1EX1.m and then cd back.
Can someone help me how to open the file correctly??

回答 (8 件)

Walter Roberson
Walter Roberson 2013 年 10 月 8 日
cd to the file's folder, type: movefile ChP1EX1.M ChP1EX1.m_bad; movefile ChP1EX1.m_bad ChP1EX1.m and then cd back
just like it says on the box :-)

Jan
Jan 2013 年 10 月 8 日
編集済み: Jan 2013 年 10 月 8 日
Or:
movefile('C:\Program Files\MATLAB\R2012b\toolbox\power\ChP1EX1.M', ...
'C:\Program Files\MATLAB\R2012b\toolbox\power\ChP1EX1.m');
Afterwards a rehash toolboxcache command might be required, when you really want to add files inside Matlab's root folder.
[EDITED] Windows is sometimes too dull to work as wanted. Perhaps an intermediate step is required:
movefile('C:\Program Files\MATLAB\R2012b\toolbox\power\ChP1EX1.M', ...
'C:\Program Files\MATLAB\R2012b\toolbox\power\ChP1EX1.m_');
movefile('C:\Program Files\MATLAB\R2012b\toolbox\power\ChP1EX1.m_', ...
'C:\Program Files\MATLAB\R2012b\toolbox\power\ChP1EX1.m');
  4 件のコメント
kashif javed
kashif javed 2021 年 1 月 13 日
Cannot find an exact (case-sensitive) match for 'barcycle.m'
The closest match is C:\Users\Kashif Javed\Downloads\Compressed\Matlab_tool_box\Matlab tool box\Folder 1\BARCYCLE.M
To change the file extension, cd to the file's folder, type:
movefile BARCYCLE.M BARCYCLE.m_bad; movefile BARCYCLE.m_bad BARCYCLE.m and then cd back.
please help me how to solve thiis error
Steven Lord
Steven Lord 2021 年 1 月 13 日
Follow the instructions in the error message.
To change the file extension, cd to the file's folder, type:
movefile BARCYCLE.M BARCYCLE.m_bad; movefile BARCYCLE.m_bad BARCYCLE.m and then cd back.
That will involve four commands:
  1. cd into the file's folder.
  2. movefile BARCYCLE.M BARCYCLE.m_bad;
  3. movefile BARCYCLE.m_bad BARCYCLE.m
  4. cd back to the folder you were in previously

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


haijun zhao
haijun zhao 2016 年 8 月 31 日
把文件ChP1EX1.M后缀大写改为小写ChP1EX1.m即可
  4 件のコメント
xiaoxiao wang
xiaoxiao wang 2018 年 6 月 22 日
very useful
kashif javed
kashif javed 2021 年 1 月 13 日
Cannot find an exact (case-sensitive) match for 'barcycle.m'
The closest match is C:\Users\Kashif Javed\Downloads\Compressed\Matlab_tool_box\Matlab tool box\Folder 1\BARCYCLE.M
To change the file extension, cd to the file's folder, type:
movefile BARCYCLE.M BARCYCLE.m_bad; movefile BARCYCLE.m_bad BARCYCLE.m and then cd back.
please help me how to solve thiis error

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


CHIYUAN
CHIYUAN 2013 年 10 月 8 日
I try movfile ('C:\Program Files\MATLAB\R2012b\toolbox\power\ChP1EX1.M); error : access denied.
I also update toolbox path cache, but I still don't have access to run any file in the toolbox.
other suggestions?
  1 件のコメント
Jan
Jan 2013 年 10 月 8 日
The shown command cannot work: A quote and the complete destination is missing. Please post a copy of the code you use, otherwise we cannot guess, what you are exactly trying to do.
The error message sounds like the currently active user do not have write access to this folder. So either login with an admin account or let the admin modify the file access permissions for this folder. But when an admin is already active, ask him for changing the ".M" to ".m" manually, because this is most likely faster than running the renaming from Matlab.

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


CHIYUAN
CHIYUAN 2013 年 10 月 8 日
I don't have the access to save and edit in the C:\Program Files\MATLAB\R2012b\toolbox location.
if someone know how to change the permission to all the files??
  2 件のコメント
Walter Roberson
Walter Roberson 2013 年 10 月 8 日
You need to be administrator to do that.
You are probably using a newer version of Windows in which everything in \Program Files\ is protected against user modification.
Jan
Jan 2013 年 10 月 8 日
@Walter: CHIYUAN wrote:
I create a subdirectory, "power", where the MATLAB toolbox resides.
It seems like admin privileges are used already. But this might be a bad idea.

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


CHIYUAN
CHIYUAN 2013 年 10 月 8 日
I use win7 64bits system,and I use right click for matlab - property - compability - privilege level -run as administer.
Still occurs error.
  1 件のコメント
Walter Roberson
Walter Roberson 2013 年 10 月 8 日
You need to log in as administrator and rename the files as indicated above.

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


Muhammad Mohsin Aman
Muhammad Mohsin Aman 2016 年 12 月 11 日

Jaime Francisco Chana Calderon
Jaime Francisco Chana Calderon 2020 年 4 月 11 日
Yo tambien estaba ensayando el codigo del profesor Hadi Saadat, y tenía el mismo problema de @CHIYUAN.
Lo solucioné de la siguiente manera. Abrí el archivo independiente, ejemplo "ZBUILD.M" y lo volví a guardar como "zbuild.m", luego de eso inicíe la función y le dí "movefile zbuild.M zbuild.m_bad; movefile zbuild.m_bad zbuild.m " en el Command Window. Luego volví a invocar la función y funcionó. Espero le sirva

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by