求问matlab 的 In an assignment A(I) = B,the number of elements
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/05/04 05:44:20
求问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
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
帅锅,你搞得频率也太密集了吧,想考验我的计算机呀
我把你的变量减少了点,只要说明问题就行
这句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
我把你的变量减少了点,只要说明问题就行
这句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
求问matlab 的 In an assignment A(I) = B,the number of elements
Matlab绘图In an assignment A(I) = B,the number of elements in
matlab中出现?In an assignment A(I) = B,the number of elements i
matlab问题求救 In an assignment A(I) = B,the number of elements
? In an assignment A(I) = B, the number of elements in B and
初学MATLAB 遇到的问题:In an assignment A(I) = B,the number of eleme
matlab报错:In an assignment A(i,j) = B,the number of columns i
matlab调用龙格库塔法出错In an assignment A(I) = B,the number of eleme
matlab运行时出现问题In an assignment A(I) = B,the number of element
MATLAB函数调用时为什么出现 In an assignment A(I) = B,the number of ele
在运行matlab为什么会出现?In an assignment A(I) = B,the number of elem
我的MATLAB积分程序出现错误To RESHAPE the number of elements must not c