How can I fix this error?

조회 수: 16 (최근 30일)
Nguyen Tuan
Nguyen Tuan 2015년 7월 17일
답변: Walter Roberson 2015년 7월 17일
I tried to create a new GUI file but I received a message:
??? Error using ==> copyfile
'attrib' is not recognized as an internal or external command,
operable program or batch file.
Error in ==> guidetemplate at 88
copyfile(srcfigfile, targetfigfile, 'writable');
Error in ==> guide at 61
filename = guidetemplate;
Can you help me with this?

채택된 답변

Walter Roberson
Walter Roberson 2015년 7월 17일
It appears that you are trying to run MATLAB R14, R14SP1, or R14SP2. The problem was fixed in R14SP3. The problem is so old that the Support Solution 1-QDJCT has been removed, so I post a copy here, extracted from http://www.lawebdelprogramador.com/foros/imprimir.php?id=1139121
=== begin text ===
Subject: Why do I receive an error when opening a template in GUIDE or when using COPYFILE in MATLAB 7.0 (R14)?
Problem Description: When I open GUIDE and select a template, I receive the following error: ??? Error using ==> copyfile Error in ==> guidetemplate at 88 copyfile(srcfigfile, targetfigfile, 'writable');
Error in ==> guide at 61 filename = guidetemplate; Alternatively, some customers experience an error message such as the following: ??? Error using ==> copyfile 'attrib' is not recognized as an internal or external command, operable program or batch file.
Solution: There is a bug in MATLAB R14 in the way it opens templates in GUIDE. It issues operating system commands like copy, attrib and when such commands are not found on the OS it throws these errors.
This bug has been fixed in Release 14 Service Pack 3 (R14SP3) in a way that it no longer depends on OS commands to open templates.
For previous product releases, read below for possible workarounds:
These error messages appear when your operating system's file copying command does not work as expected with MATLAB. To verify this, try using the "copy" command from a DOS command prompt.
1. Select "Run" from the "Start" menu. 2. Type "cmd" or "command" in the dialog box and click "OK". 3. At the DOS command prompt, type:
copy /? If there is no output, then it is likely that the "copy" command is not on your system path.
If you are receiving an error regarding "attrib" not being recognizable, it indicates the "attrib" command is not on your system path. Similarly to the copy function, you can confirm this by typing the following in a DOS command window:
attrib /? These files should be present in the windowssystem32 directory and this directory should be present in the system's path. If you are not able to locate these files on your system, please contact your system administrator or Microsoft's technical support department, since these files are not provided by MATLAB itself, but rather by the operating system.

추가 답변 (1개)

Image Analyst
Image Analyst 2015년 7월 17일
Why do you think 'writable' is an option that you can use? I don't see it in the documentation. Try it without it:
copyfile(srcfigfile, targetfigfile);
  댓글 수: 1
Nguyen Tuan
Nguyen Tuan 2015년 7월 17일
It didn't work. Please help me!!

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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by