0

My matlab files are like:

  1. main.m
  2. func1.m
  3. func2.m
  4. func3.m

I want to include the function definitions in the main.m file.

main.m with function definitions included runs well in GUI. However, it fails in command line. I have to keep the function definitions in separate files. Any clue how to work around this problem?

Here is the command line that I use

matlab -nodisplay -nosplash -nodesktop < main.m > log &
Pladin
  • 1
  • 1
  • [duplicate](https://stackoverflow.com/questions/5969547/how-to-correct-function-definitions-are-not-permitted-at-the-prompt-or-in-scrip) [of](https://stackoverflow.com/questions/45077938/matlab-error-function-definitions-are-not-permitted-at-the-prompt-or-in-scripts) [these](https://stackoverflow.com/questions/7667143/matlab-error-message-function-definitions) – shirleyquirk Feb 08 '21 at 22:07
  • Does this answer your question? [In MATLAB, can I have a script and a function definition in the same file?](https://stackoverflow.com/questions/5363397/in-matlab-can-i-have-a-script-and-a-function-definition-in-the-same-file) – shirleyquirk Feb 08 '21 at 22:12

1 Answers1

0

Have you tried to compile the application under Apps->Application Compiler?