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

Awais Saeed
Awais Saeed 2021년 12월 18일
plot is a built-in command in MATLAB. You cannot save your scripts as command names. Rename your script name.
Liong Han Wen
Liong Han Wen 2021년 12월 19일
Hi, I don't understand your explanation. May be can you show me how to rename the script name? Sorry I am new in Matlab. Thank you very much
Steven Lord
Steven Lord 2021년 12월 19일
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.
Liong Han Wen
Liong Han Wen 2021년 12월 19일
Ok, i got it. Thank you very much

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2021년 12월 18일

댓글:

2021년 12월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by