graph plot for array
2 views (last 30 days)
Show older comments
Hi, I try to plot an graph by using the array data. Below is my code:
x = [1 2 3 4 5 6 7 8 9 10 11 12]
y = [0 1 1 1 1 0 0 0 0 0 0 0]
plot(x,y)
However, this is an error message as shown below:
Attempt to execute SCRIPT plot as a function:
D:\Documents\Matlab\neural network\quadractic modelling\plot.m
Any problem with my coding?
4 Comments
Steven Lord
on 19 Dec 2021
Open Windows Explorer and navigate to this directory: D:\Documents\Matlab\neural network\quadractic modelling
Find the plot.m file in the Windows Explorer window.
Rename it to something like myplot.m so it doesn't take precedence over the plot function included in MATLAB.
Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!