求问matlab 的 In an assignment A(I) = B,the number of elements in B and I must be the same.错在啊clear all;close allf(1)=1000;f(2)=400;f(3)=60;a(1)=0.005;a(2)=0.01;a(3)=0.02;f=2000;t=0:0.001:f-0.001;for i=1:3;x(i)=exp(-a(i)*2*pi*f(i)*t).*sin(2*

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/20 07:32:06
求问matlab 的 In an assignment A(I) = B,the number of elements in B and I must be the same.错在啊clear all;close allf(1)=1000;f(2)=400;f(3)=60;a(1)=0.005;a(2)=0.01;a(3)=0.02;f=2000;t=0:0.001:f-0.001;for i=1:3;x(i)=exp(-a(i)*2*pi*f(i)*t).*sin(2*
x_OH 8r] ! ⴎm⸱Q=P( hB PTUχ׎^;>\uҽdigfgfǿٲ36ثa )`uˮ~Lq@yj{M0Q3mX6NCt0Ӯ4Ğ.hml!KjJpX23SP13"L8oy*LDT$**a K*W٪&TTũƌ5crYײ3b5Y R5s"I S.I>TcJBVL ,qPc?@7PݦA̕XaiNkNe$dq <>>SA3Y7$GkEç?ɫr=_k>ך6; 73n%hIV6+~mΞd堷wtl>Mrb{޿hlu`Q%#l9 N~'>}G 5 |?[QoIǤ!n“#>\矂u^&[$/{;o.dĥUrN)H<{ϫ~|IU^# M;w02`dA26dڏڔIU餶|r :پw"u ǀ۬cUsJ媖Smx 7aKUuתpzEYx?DjQhJ&0*> uM҄ 3IeY<.ceMHvh)"Z Z΋P9 Te)_1 2b~+fveu=y

求问matlab 的 In an assignment A(I) = B,the number of elements in B and I must be the same.错在啊clear all;close allf(1)=1000;f(2)=400;f(3)=60;a(1)=0.005;a(2)=0.01;a(3)=0.02;f=2000;t=0:0.001:f-0.001;for i=1:3;x(i)=exp(-a(i)*2*pi*f(i)*t).*sin(2*
求问matlab 的 In an assignment A(I) = B,the number of elements in B and I must be the same.错在啊
clear all;
close all
f(1)=1000;
f(2)=400;
f(3)=60;
a(1)=0.005;
a(2)=0.01;
a(3)=0.02;
f=2000;
t=0:0.001:f-0.001;
for i=1:3;
x(i)=exp(-a(i)*2*pi*f(i)*t).*sin(2*pi*f(i)*t.*sqrt(1-a(i)))
end
for i=1:3
subplot(31i);plot(t,x(i));
end

求问matlab 的 In an assignment A(I) = B,the number of elements in B and I must be the same.错在啊clear all;close allf(1)=1000;f(2)=400;f(3)=60;a(1)=0.005;a(2)=0.01;a(3)=0.02;f=2000;t=0:0.001:f-0.001;for i=1:3;x(i)=exp(-a(i)*2*pi*f(i)*t).*sin(2*
帅锅,你搞得频率也太密集了吧,想考验我的计算机呀
我把你的变量减少了点,只要说明问题就行
这句x(i)=exp(-a(i)*2*pi*f(i)*t).*sin(2*pi*f(i)*t.*sqrt(1-a(i))) 有问题
首先,f是一个常数,不是一个数组,那来的f(i)呢?
第二,t是一个数组,你却想赋值给一个元素
第三,画图时,x(1)、x(2)、x(3)只代表一个元素,如何画图?
给你改了一下,可以运行了:
clear all;clc;
f(1)=1000;
f(2)=400;
f(3)=60;
a(1)=0.005;
a(2)=0.01;
a(3)=0.02;
f=20;
t=0:0.01:f-0.01;
for i=1:3
      x(i,:)=exp(-a(i)*2*pi*f*t).*sin(2*pi*f*t*sqrt(1-a(i)));
end   
for i=1:3   
    subplot(3,1,i);
    plot(t,x(i,:));
end