Why am I getting invalid function error for a function in an installed package?

조회 수: 5 (최근 30일)
Idban Alam
Idban Alam 2018년 11월 14일
댓글: Zhen Liu 2020년 2월 19일
I have gone through many answers to similar problems on MATLAB answers. So, I uninstalled the deep learning toolbox and deep learning toolbox for googlenet, and reinstalled them. But, one of the function "findLayersToReplace" is giving me the above error. The .m file for the function exists in the following directory C:\..\MATLAB\Examples\nnet\findLayersToReplace.m. Here is how I am trying to call the function in my code.
[Lernablelayers, classLayer] = findLayersToReplace(neuralnetlayers);
I tried running the command "restoredefaultpath". It made other toolboxes, which were working before, to stop working. Then, I saved a copy of "findLayersToReplace.m" in the same directory where I saved my code. I can see all the desired toolboxes when I run the command "ver". But, the function is not working. Can anyone please tell me what is the proper way to implement this function? I would really appreciate the help.
  댓글 수: 3
Idban Alam
Idban Alam 2018년 11월 15일
This is what I got:
>> which -all findLayersToReplace
'findLayersToReplace' not found.
Walter Roberson
Walter Roberson 2018년 11월 15일
To confirm, even though you are cd'd to the directory that you copied findLayersToReplace.m into, which says that it cannot find it? As in
ls findLayersToReplace.m
says it is in your current directory, but which says it doesn't know it? And to confirm, the directory you are working in is one of your own directories, not something underneath where MATLAB is installed?

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

답변 (1개)

Johannes Bergstrom
Johannes Bergstrom 2018년 11월 15일
Hi,
MATLAB examples have supporting files that are off the path and stored in the Examples directory. To run any MATLAB example with supporting functions, you must open the example in MATLAB. You can do this by clicking the 'Open Example' or 'Open Live Script' or 'Try it in MATLAB' blue buttom in the top right corner of the example in the doc. In this case, this is the example:
MATLAB then copies all the supporting files to the example folder and opens the example. You can then run the example
  댓글 수: 5
Tahmina Sumi
Tahmina Sumi 2020년 1월 30일
@Idban Alam i am facing the same prblem...how did u get rid of it?plz help
Zhen Liu
Zhen Liu 2020년 2월 19일
hello, i didnt even find findLayersToReplace.m。where should i go

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

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by