Unrecognized function or variable 'tradeoff'

I am trying to execute a code on Matlab from a known script and i am receiving this answer:
Unrecognized function or variable 'tradeoff'.
The scrip was made to a version of matlab in 2017, and using a open-source toolbox for MATLAB called MTEX
The script:
% Use trade-off curve to find cutoff between well-constrained and poorly-constrained grains
knee = tradeOff(fraction);
xlabel('Number of grains (cumulative)')
ylabel('Indexed fraction')
I tried to change for different forms like "TradeOff" "Tradeoff" "tradeoff" "tradeOff
If someone could help me I would really appreciate it
Thank you

 채택된 답변

Star Strider
Star Strider 2024년 1월 10일

0 개 추천

The only reference I can find in the File Exchange is MTEX2Gmsh.
If this is the correct citation, you will need to download and install it.

댓글 수: 4

Renata
Renata 2024년 1월 10일
Thank you for the quick answer!!!
I am already using Mtex2Gmsh.
Do you think is a problem with the software?
My pleasure!
I thought that the problem was that you needed the function and did not have it.
The MATLAB version is likely not the issue.
The ‘tradeOff’ reference appears to be to a function, since it has an argument that is likely not an index (unless ‘fraction’ is an integer greater than zero, and that seems unlikely). I looked at the ‘Functions’ section of that File Exchange contribution, and could not find ‘tradeOff’ listed among them (however a number of its functions have names that could overshadow MATLAB functions with the same names (such as ‘mesh’), which is something I urge you to consider if there are any conflicts).
The only other option is that ‘tradeOff’ is a function that was apparently written locally and the script you are using does not have access to it. The best approach is to contact the author of the script you are using (if possible) and ask where to find the ‘tradeOff’ function. Otherwise, use the appropriate operating system function (such as Windows File Explorer) to see if it exists somewhere on your computer. If it does (it is likely a separate function file), copy it to somewhere on your MATLAB search path so your script will have access to it. Also, look on the computer your script was written on to see if ‘tradeOff.m’ exists somewhere on it. If it does, then copy it and transfer it.
Renata
Renata 2024년 1월 10일
I really appreciate all support and ideas!
All the best
My pleasure!

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

추가 답변 (1개)

Luke Hill
Luke Hill 2024년 3월 5일

0 개 추천

The tradeOff function is a script used in the paper of Cross et al. (2017) - you can download it from the supporting information section of their publication. Store the tradeOff.m script in the same folder as your matlab project and then the code "knee = tradeOff(fraction)" should work automatically.

카테고리

도움말 센터File Exchange에서 Downloads에 대해 자세히 알아보기

제품

릴리스

R2023b

태그

질문:

2024년 1월 10일

답변:

2024년 3월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by