Function definitions are not permitted in this context.
3 次查看(过去 30 天)
显示 更早的评论
I am having this error "Function definitions are not permitted in this context." writing this
A = spdiags([-1 a11 0;ones(n-2,1)*[-1 2 -1];0 a11 -1],-1:1,n,n)'/h^2;
0 个评论
采纳的回答
Image Analyst
2016-4-27
You have probably combined a function and a script in the same m-file. You can't do that. If your script is called test.m, and has MyFunction defined in it some where, then make sure this is the first line of your test.m
function test()
2 个评论
Image Analyst
2016-4-27
You forgot to paste the actual error message. Maybe you want dt.*nt - I have no idea.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!