plot function not working
85 次查看(过去 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!