Undefined function 'trapmf' for input arguments of type 'double'.

조회 수: 5 (최근 30일)
Simon
Simon 2017년 4월 15일
댓글: Sam McDonald 2017년 4월 19일
Hi, I used the functions trapmf and trimf in a code for designing a fuzzy controller, and they worked.
Err_X=[-75:1:75]; %% Universe
NB=trapmf(Err_X,[-75 -75 -40 -10]);
Then, I downloaded NI Elvis software for myDaq, and now I run the same code, but it says undefined. I tried this
which trapmf
C:\Program Files\MATLAB\R2016a\toolbox\fuzzy\fuzzy\trapmf.m % Has no license available
This is wierd because my matlab license has not expired yet, and I also have fuzzy toolbox 30 day trial, and it has not expired yet, and it is not working either even though when I use the command ver, I see the toolbox. I also typed path in command windows and I found this
C:\Program Files\MATLAB\R2016a\toolbox\fuzzy\fuzzy
I went to this directory and I found trapmf and trimf files there and I could open them.
I searched online for a solution, and some people talked about the file directory, and I have the script file in matlab directory.
Could you please help me solve this issue. Thanks

답변 (2개)

Sam McDonald
Sam McDonald 2017년 4월 19일
From what you have described, it does appear that your trial has expired, or at least MATLAB registers that the trial has expired. This is another post related to your same issue:
If you are certain that your trial has not expired, you could try to the following commands:
restoredefaultpath
rehash toolboxcache
Try your script again. If that resolves the issue, then execute
savepath
You could also try Home > Help > Licensing > Update Current Licenses or Manage Licenses to see if your trial for the Fuzzy Logic Toolbox is still active.
  댓글 수: 2
Simon
Simon 2017년 4월 19일
편집: Simon 2017년 4월 19일
I tried these commands, but they did not solve the problem. Then, I copied the files of fuzzy toolbox and the script to desktop, and they worked. Then, matlab stopped working two days later, and I could not even do 5+5. Every time I run a script 5+5, it says undefined, but I could do 5+5 in the command window. Finally, I uninstalled matlab and installed it again, and that solved the issue. Thank you for your answer.
Sam McDonald
Sam McDonald 2017년 4월 19일
Glad you got it working now. I have posted an Answer below for others to see if they have the same issue.

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


Sam McDonald
Sam McDonald 2017년 4월 19일
Installation of thrid-party software may have currupted the MATLAB installation. A re-installation of MATLAB solves this issue

카테고리

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