Tom
Tom

Reputation: 1749

MatLab - Undefined function or variable 'script'

I have a script, called TESTSCRIPT. It was running fine since I created it several hours ago, but now whenever I try to run it, either by pressing F5 or using the command prompt, I get the error message

Undefined function or variable 'TESTSCRIPT'

TESTSCRIPT is in fact a solution to another script file that had suffered the same consequence. I have read through many people's MatLab Forum posts, and I have tried many, if not all, the solutions given:

The only thing that stood out when I did all these was when I typed which TESTSCRIPT and got <path>\MATLAB\TESTSCRIPT\TESTSCRIPT.m % Has no license available. I definitely do have a license, because I've been using it for the last 8-9 months without a problem.

I cannot put breakpoints within the code. When I try, a window pops up and says:

License Checkout failed. License Manager Error -39

along with other stuff.

Scripts older than a week run fine when I hit F5. If I select a piece of code, within TESTSCRIPT, and run just that selection (by pressing F9), that runs without a problem.

My first thought was the file is corrupt, but then a new file would have worked, and this being the third time I've had to creat a new set of files, I'm confident it is not the case.

What is going on, and how do I solve this?


UPDATE

This seems to have resolved itself when I closed and opened MatLab. It does not explain why it has done this, but the problem seems to be solved.

Upvotes: 1

Views: 1510

Answers (1)

Daniel
Daniel

Reputation: 36710

Both dec2rad and pi are builtin functions, rename both variables to avoid the error.

Upvotes: 0

Related Questions