How do I fix the error "Function definitions are not permitted at the prompt or in scripts"?
1 次查看(过去 30 天)
显示 更早的评论
I get an error when I type this:
function S = timestr(D,precision)
Here is the error:
Error: Function definitions are not permitted at the prompt or in scripts.
What does it mean?
1 个评论
Jan
2011-5-27
After you've edited the text, your question is clearer. And you type this in the command line? Do you want to create the function or do you have a file called "timestr.m" already?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!