Error function definitions are not permitted in this context
Show older comments
Hi,
Im trying to execute timbre toolbox on Mathlab 2017a, however there is an error ..
Can you help me in understanding this error? Thank you

12 Comments
Image Analyst
on 3 Nov 2019
The error probably is caused by what's above this, which we can't see. Attach the whole m-file.
Maria de São Luís Castro
on 4 Nov 2019
Edited: Guillaume
on 4 Nov 2019
Adam Danz
on 4 Nov 2019
How are you running this function?
Maria de São Luís Castro
on 4 Nov 2019
Running a function from within the editor using F5 would result in the error "Not enough input arguments." since F5 doesn't supply any input arguments to the function.
The image in your question shows that the function is declared on line 26 but the code you shared in the comment above only has ~9 lines prior to the function declaration.
Either you're running the function from the command window your there's other stuff at the top of the file that you haven't shared.
As for your new error, "config_s" is a variable (update: or a function as explained below by Guillaume) in your function but is never defined. Also, if you're getting to that line in your code, then you are no longer getting the original function definition error.
This leads me to conclude that you were getting that error by defining the function from the command window (as is explained in my answer below).
Guillaume
on 4 Nov 2019
config_s could also be a function provided by the toolbox, in which case the error could be due to a path issue.
Note that the code pasted above is clearly copyrighted, so posting it on a public website is not ok. It should be replaced by a link to the toolbox, if it is publicly available (which would also help us understand the problem, since we can then test that toolbox).
Maria de São Luís Castro
on 4 Nov 2019
Adam Danz
on 4 Nov 2019
Now there are 3 questions in this thread.
Before moving on to the 3rd question,
- Is the first one answered regarding the function definition error?
- Do you understand the comments by myself and Guillaume regarding the config_s error?
Now for your 3rd question, the line you're asking about (copied below) is a function definition that exists in an m file. FILE_s is an output that is defined somehwere within the function Gget_filelist().
[FILE_s] = Gget_filelist(w_Directory, EXT);
Maria de São Luís Castro
on 4 Nov 2019
Edited: Maria de São Luís Castro
on 5 Nov 2019
There are too many changes to the questions here. The problem is not well defined and the topic is changing every few minutes. This usually happens when the problem is not clear to the person asking the question. Often times the answer to a question will lead to additional questions and that's OK but this thread is spiraling out of control. Please take some time to figure out what the problem is.
Maria de São Luís Castro
on 4 Nov 2019
Adam Danz
on 4 Nov 2019
ahh... in that case, i'm not sure what to recommend if the output is not defined within the function. Is there a typo or any indication of what the output should be?
Accepted Answer
More Answers (0)
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!