Somehow all interactive use of fplot and all of my codes that use fplot get this Error:

1 vue (au cours des 30 derniers jours)
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))

Réponses (1)

Steven Lord
Steven Lord le 10 Avr 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 commentaires
Robert Kunz
Robert Kunz le 10 Avr 2017
Hi Steven: Thanks for the quick reply. Here is the result: C:\Program Files\MATLAB\R2016b\toolbox\matlab\specgraph\fplot.m Thanks you Rob
Steven Lord
Steven Lord le 10 Avr 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by