matlab 不能使用xlabel提示错误如下>> sincxAttempted to access xlabel(120); index out of bounds because numel(xlabel)=1.Error in sincx (line 6)xlabel('x');程序如下x=linspace(0,10,21);y=sinc(x);subplot(2,1,1);plot(x,y);title('step=0.5');xl
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/19 13:11:30
![matlab 不能使用xlabel提示错误如下>> sincxAttempted to access xlabel(120); index out of bounds because numel(xlabel)=1.Error in sincx (line 6)xlabel('x');程序如下x=linspace(0,10,21);y=sinc(x);subplot(2,1,1);plot(x,y);title('step=0.5');xl](/uploads/image/z/14079441-57-1.jpg?t=matlab+%E4%B8%8D%E8%83%BD%E4%BD%BF%E7%94%A8xlabel%E6%8F%90%E7%A4%BA%E9%94%99%E8%AF%AF%E5%A6%82%E4%B8%8B%3E%3E+sincxAttempted+to+access+xlabel%28120%29%3B+index+out+of+bounds+because+numel%28xlabel%29%3D1.Error+in+sincx+%28line+6%29xlabel%28%27x%27%29%3B%E7%A8%8B%E5%BA%8F%E5%A6%82%E4%B8%8Bx%3Dlinspace%280%2C10%2C21%29%3By%3Dsinc%28x%29%3Bsubplot%282%2C1%2C1%29%3Bplot%28x%2Cy%29%3Btitle%28%27step%3D0.5%27%29%3Bxl)
matlab 不能使用xlabel提示错误如下>> sincxAttempted to access xlabel(120); index out of bounds because numel(xlabel)=1.Error in sincx (line 6)xlabel('x');程序如下x=linspace(0,10,21);y=sinc(x);subplot(2,1,1);plot(x,y);title('step=0.5');xl
matlab 不能使用xlabel
提示错误如下
>> sincx
Attempted to access xlabel(120); index out of bounds because numel(xlabel)=1.
Error in sincx (line 6)
xlabel('x');
程序如下
x=linspace(0,10,21);
y=sinc(x);
subplot(2,1,1);
plot(x,y);
title('step=0.5');
xlabel('x');
ylabel('sinc x');
无法对画出的sincx函数图形添加xlabel 和ylabel ,求问怎么解决
matlab 不能使用xlabel提示错误如下>> sincxAttempted to access xlabel(120); index out of bounds because numel(xlabel)=1.Error in sincx (line 6)xlabel('x');程序如下x=linspace(0,10,21);y=sinc(x);subplot(2,1,1);plot(x,y);title('step=0.5');xl
代码是没问题的,之所以出错,原因是你在之前(很可能是无意识地)把xlabel当作变量用了.
先clear一下就可以了.