Attempt to execute SCRIPT <filename> as a function
Show older comments
Hi all, I am a new user of Matlab. Im learning how to debug a .m file called "test.m". I was asked to copy one backup, I made the name "test_debug.m". When I run the test_debug.m file, there is a error msg,
Attempt to execute SCRIPT test as a function: D:\ProgramFiles\Reference_src\test.m
test.m is not in path. But it could still successful run. It has called several functions inside the script. What should I add into/make changes for test_debug.m?
Thank you!
3 Comments
zakria qadir
on 13 Aug 2020
i am getting this error?
Attempt to execute SCRIPT newplot as a function:
D:\MATLAB\R2017a\toolbox\matlab\graphics\newplot.m
Error in contour (line 66)
cax = newplot(cax);
Error in PSO_simulation (line 19)
contour(x_new, y_new, z , 20);
>>
Image Analyst
on 14 Aug 2020
Chances are you named your m-file after a built-in function. Attach your m-file with the paper clip icon in a new question.
Walter Roberson
on 14 Aug 2020
You would get that error message if you had accidentally corrupted newplot.m such as accidentally typing in a few characters before the 'function' line.
Accepted Answer
More Answers (0)
Categories
Find more on Entering Commands 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!