matlab subplot的疑问~B = [0.3 1 3 10];for a = 1:4range = -6:0.1:6;for i = 1:121A = sine_int(2*pi*B(a)*(range(i)+1));%已经定义了sine_int 函数B = sine_int(2*pi*B(a)*(range(i)-1));g(i) = (A-B)/pi;endsubplot(2,3,a);plot(range,g);end错误是Ind
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/25 21:15:44
matlab subplot的疑问~B = [0.3 1 3 10];for a = 1:4range = -6:0.1:6;for i = 1:121A = sine_int(2*pi*B(a)*(range(i)+1));%已经定义了sine_int 函数B = sine_int(2*pi*B(a)*(range(i)-1));g(i) = (A-B)/pi;endsubplot(2,3,a);plot(range,g);end错误是Ind
matlab subplot的疑问~
B = [0.3 1 3 10];
for a = 1:4
range = -6:0.1:6;
for i = 1:121
A = sine_int(2*pi*B(a)*(range(i)+1));%已经定义了sine_int 函数
B = sine_int(2*pi*B(a)*(range(i)-1));
g(i) = (A-B)/pi;
end
subplot(2,3,a);plot(range,g);
end
错误是Index exceeds matrix dimensions.,但是我不知道哪里错了,请说说怎么解决?
matlab subplot的疑问~B = [0.3 1 3 10];for a = 1:4range = -6:0.1:6;for i = 1:121A = sine_int(2*pi*B(a)*(range(i)+1));%已经定义了sine_int 函数B = sine_int(2*pi*B(a)*(range(i)-1));g(i) = (A-B)/pi;endsubplot(2,3,a);plot(range,g);end错误是Ind
把A,B全部换成A(i),B(i)就行了