matlab 画图,想加图形注释,哪错了???????

来源:百度知道 编辑:UC知道 时间:2024/05/07 06:57:51
>> x=0:0.1:10;
subplot(2,2,1)
plot(x,sin(x),'c-.')
xlable(‘x’)
ylable(‘y’)
title(‘sin(x)’)
subplot(2,2,2)
plot(x,cos(x),'b:')
subplot(2,2,3)
plot(x,sin(2*x),'r-*')
subplot(2,2,4)
plot(x,cos(2*x),'g:o')
按“enter”后,提示
??? xlable(‘x’)

Error: Missing variable or function.

x=0:0.1:10;
subplot(2,2,1)
plot(x,sin(x),'c-.')
xlabel('x')
ylabel('y')
title('sin(x)')
subplot(2,2,2)
plot(x,cos(x),'b:')
subplot(2,2,3)
plot(x,sin(2*x),'r-*')
subplot(2,2,4)
plot(x,cos(2*x),'g:o')

1.请在编程时使用英文输入法,切忌不使用中文输入法。
2.label单词错误。

xlable(‘x’)
单引号,应为英文状态下输入的形式。如''