Creating a custom copy of a Matlab function (xlsread)
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I'm trying to create a copy of the xlsread function that will work slightly differently for my particular application.
What I tried is typing
edit xlsread
then going file/save as, and saving it in my working directory under a different name (and changing the function name to match its new file name).
When I try to use the new function, I get the following error:
??? XLSREAD unable to open test.xls. Undefined function or method 'validpath' for input arguments of type 'char'.
What is the problem?
댓글 수: 0
채택된 답변
Andy
2011년 5월 11일
If you type
which xlsread
you will see something like
C:\Program Files\MATLAB\R2009a\toolbox\matlab\iofun\xlsread.m
In the parent folder ...\iofun\, there is a subfolder ...\iofun\private, and this contains the function validpath. Mine is at:
C:\Program Files\MATLAB\R2009a\toolbox\matlab\iofun\private\validpath.m
If you also copy this file to the same location as your copy of xlsread, it should work. I highly recommend you change the name of the local copy of validpath (and change the call to it in your local copy of xlsread). It is clearly not a supported function, and may be used internally by other MATLAB functions. So if you altered your local file, you won't know what other consequences it might have.
Good luck.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!