An error occurred while trying to determine whether "dataset" is a function name.
4 次查看(过去 30 天)
显示 更早的评论
Hi all, I'm using a toolbox called PRTools which I have to use for a course I'm following. Somewhere I have to call a function, and then this function calls a function named 'pr_dataset'. The error I receive is the following: An error occurred while trying to determine whether "dataset" is a function name. I've read some things about not having the right license, which I don't think is the case because this function is in the toolbox that I downloaded, which just has the files in a folder on my computer. Also I've read about problems when using 'addpath' in startup.m. I use 'addpath', but not from the startupfile. I just call 'addpath' at the beginning of the script I'm writing. I also tried adding
%#function pr_dataset
but that doesn't seem to help. Now I've figured out that when I add the folder with the toolbox by using 'addpath', I have this problem, but when I manually add the folder by right-clicking it in the folder structure and adding it to the path, everything works fine. However I'd like to be able to use the 'addpath' because it is very inconvenient having to add the path manually all the time. Does anyone have any clue as to what is going on and how to fix this? Any help is much appreciated.
Kind regards, Iris
0 个评论
回答(2 个)
Usha Duddu
2016-1-8
Hi
I understand that you have issues using "addpath" function. Please make sure that you do not have your custom script with the name "addpath.m". This will make sure that pre-built MATLAB script "addpath.m" is not shadowed by your custom script "addpath.m"(if you have one).
Try using "fullfile" function within "addpath" as follows-
>>addpath(genpath(fullfile(pwd,'../external/matlab_xunit')))
Also execute the following MATLAb functions before using "addpath"
>>restoredefaultpath
>>rehash toolboxcache
Hope this helps
Thanks
Usha
Walter Roberson
2016-1-8
You wrote,
An error occurred while trying to determine whether "dataset" is a function name
Notice that refers to "dataset" not "pr_dataset". So you need to %#function dataset
(and you would need to have the Statistics toolbox as that is what defines dataset)
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!