matlab中语句 >>x=0:10/pi:2*pi; >>sinx=sin(x); >>figure,plot(x,sinx,'Line Width',4) 为什么会报错?Error using plotInvalid property found.Object Name :lineProperty Name :'Line Width'.
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/28 15:26:15
![matlab中语句 >>x=0:10/pi:2*pi; >>sinx=sin(x); >>figure,plot(x,sinx,'Line Width',4) 为什么会报错?Error using plotInvalid property found.Object Name :lineProperty Name :'Line Width'.](/uploads/image/z/8796350-38-0.jpg?t=matlab%E4%B8%AD%E8%AF%AD%E5%8F%A5+%3E%3Ex%3D0%3A10%2Fpi%3A2%2Api%3B+%3E%3Esinx%3Dsin%28x%29%3B+%3E%3Efigure%2Cplot%28x%2Csinx%2C%27Line+Width%27%2C4%29+%E4%B8%BA%E4%BB%80%E4%B9%88%E4%BC%9A%E6%8A%A5%E9%94%99%3FError+using+plotInvalid+property+found.Object+Name+%3AlineProperty+Name+%3A%27Line+Width%27.)
matlab中语句 >>x=0:10/pi:2*pi; >>sinx=sin(x); >>figure,plot(x,sinx,'Line Width',4) 为什么会报错?Error using plotInvalid property found.Object Name :lineProperty Name :'Line Width'.
matlab中语句 >>x=0:10/pi:2*pi; >>sinx=sin(x); >>figure,plot(x,sinx,'Line Width',4) 为什么会报错?
Error using plot
Invalid property found.
Object Name :line
Property Name :'Line Width'.
matlab中语句 >>x=0:10/pi:2*pi; >>sinx=sin(x); >>figure,plot(x,sinx,'Line Width',4) 为什么会报错?Error using plotInvalid property found.Object Name :lineProperty Name :'Line Width'.
把'Line Width'中的空格去掉,即'LineWidth'即可.程序可以正常运行,但实际上,这样画图只能得到一条直线,因为x的递增是10/pi,也就是说第一点是x=0 y=0,第二点是x=10/pi=3.18 y=-0.055,而x的上限是2*pi=6.28,所以,图像上只会有由这两个点连成的一条直线.
建议将程序改成:
x=0:pi/10:2*pi;%递增是pi/10,不是10/pi
y=sin(x);
figure,plot(x,y,'LineWidth',4);