Somehow all interactive use of fplot and all of my codes that use fplot get this Error:
3 ビュー (過去 30 日間)
古いコメントを表示
Error: File: fplot.m Line: 65 Column: 5 Function definitions in a script must appear at the end of the file. Move all statements after the "searchLinespec" function definition to before the function definition.
I cant even open MATLAB and enter fplot(@(x) sin(x))
0 件のコメント
回答 (1 件)
Steven Lord
2017 年 4 月 10 日
Are you sure you're using the fplot function included in MATLAB? Use this command to check that you're not calling a different fplot function.
which -all fplot
If you are using the function in MATLAB, make sure you haven't modified that function. If you have, hopefully you made a backup copy and can restore it to its original state using that backup (or can undo the modifications you made.)
2 件のコメント
Steven Lord
2017 年 4 月 10 日
So that suggests to me that you have edited fplot.m and commented out the first line of the code. Open the file in the MATLAB Editor (DON'T change anything yet!) and look in the upper-right corner of the Editor window. Is the box there green (it should be) or red (I suspect it will be)? If it's red, check if the first line is a comment line (it shouldn't be, but I suspect it is) or the uncommented function declaration line (it should be.)
If it's the function declaration line "function varargout = fplot(varargin)" but is commented out, uncomment it.
If it is "%FPLOT Plot 2-D function", you deleted the function declaration line and should add the function declaration line back.
If it's something else, there's something else going on and you should probably work with Technical Support (use the Contact Us link at the top of this page) to correct the problem.
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!