Hi everyone, can anybody help me to plot?

I have this error:
Execution of script plot as a function is not supported:
/MATLAB Drive/plot.m
my code is:
x = linspace(0.5* pi, 1000);
y = sin(x)
Y = fft(y);
plot(Y)

4 Comments

Jonas
Jonas on 12 Jun 2021
Edited: Jonas on 12 Jun 2021
do you execute your code in a script that is called 'plot'? then it will be difficult to use the default matlab plot command inside. dont name your functions / scripts equal to default matlab functions
change your script name to e.g. 'myPlotting' in that case
Jonas. That looks like an Answer to me, so put it down in the official Answer section below so the poster can accept it and you can get credit for it so you can move from a "Rising Star" to an "MVP".
i will do that, i was not sure about the reason behind the error, that's why i posted it as a proposition as comment.

Sign in to comment.

Answers (1)

Jonas
Jonas on 13 Jun 2021
do you execute your code in a script that is called 'plot'? then it will be difficult to use the default matlab plot command inside. dont name your functions / scripts equal to default matlab functions
change your script name to e.g. 'myPlotting' in that case

Categories

Find more on Programming in Help Center and File Exchange

Asked:

on 12 Jun 2021

Answered:

on 13 Jun 2021

Community Treasure Hunt

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

Start Hunting!