Getting a function I downloaded online to run
조회 수: 3(최근 30일)
표시 이전 댓글
Hey guys, I'm extremly new to programming, so be patient with me!
I downloaded this script: https://www.mathworks.com/matlabcentral/fileexchange/33616-integer-partitions
and put it in a certain folder on my desktop, then used the addpath tool to add a path to this folder. I opened up the file in MatLab and the script appeared in an "editor window".
Now, if I type in intpartition(4) the output should be {[1 1 1 1],[1 1 2],[1 3],[2 2],4}
But instead it's saying
Undefined function or variable 'intpartition'.
What is the problem here? Did the addpath not work correctly? I find this strange because I got another program, nsumk, to run just fine, and they are in the same folder.
Thanks!
댓글 수: 0
답변(1개)
Star Strider
2020년 9월 19일
Second, see what:
which('intpartition.m')
returns.
댓글 수: 4
John D'Errico
2020년 9월 20일
If you added the folders using addpath, verify you did it properly. path will tell you that. And then, make sure you SAVED the path, so it will be there next time.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!