Somehow all interactive use of fplot and all of my codes that use fplot get this Error:
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Steven Lord
el 10 de Abr. de 2017
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 comentarios
Steven Lord
el 10 de Abr. de 2017
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.
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!