plot function not working
조회 수: 99 (최근 30일)
이전 댓글 표시
Hi, i am trying to plot this simple code but my matlab is not supporting plot function as shown in the error, please help me what to do.
t=0:0.001:0.2;
y=t*2;
plot(t,y);
Warning: Function plot has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.
> In matlab.internal.getCode (line 22)
In mtree (line 118)
In matlab.unittest.internal.ui.toolstrip.getFileInfoForToolstrip (line 29)
Execution of script plot as a function is not supported:
/MATLAB Drive/plot.m
Error in untitled (line 3)
plot(t,y);
Warning: Function plot has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.
댓글 수: 3
Ajay Sharma
2023년 12월 15일
이동: Cris LaPierre
2023년 12월 15일
xecution of script plot as a function is not supported:
C:\Users\91999\Documents\MATLAB\plot.m
Please give solution
Walter Roberson
2023년 12월 15일
이동: Cris LaPierre
2023년 12월 15일
Rename C:\Users\91999\Documents\MATLAB\plot.m to some name that is not used by MATLAB.
답변 (1개)
Cris LaPierre
2021년 9월 23일
You have saved the script containing your code as 'plot.m'. However, that is the same name as the plot function in MATLAB. Give your script a different name (myPlot.m?) and the error will go away.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!