脚本行中的3个错误-11、13、28

1view (last 30 days)
Pankaj Khaire
Pankaj Khaire 2021年8月8日
“冲击响应频谱”;
'CRLF';
ymax = [];
ff = [];
fmin = 1;
fmax=1000;
n = 90;
qv =(fmax/fmin)^(1/n);
t = 1/get(input1,'Freq');
Q = 10;
为了[i=0;1;1i
{
fn = [fmin*qv^i];
ff = [ff,fn];
wn = 2*pi*fn;
a = wn*t/2/q;
b = wn*t*sqr(1-1/4/q/q);
b0 = 1-exp(-a)*sin(b)/b;
b1 = 2*exp(-a)*(sin(b)/b-cos(b));
b2 = exp(( - 2)*a)-exp(-a)*sin(b)/b;
a1 =( - 2)*exp(( - 1)*a)*cos(b);
a2 = exp(( - 2)*a);
BB = [B0,B1,B2];
aa = [ - a1,-a2];
y = filter(input1,bb,aa);
yy = max(y);
ymax = [ymax,yy];
};
保存(ff);
保存(ymax);

答案(1)

DGM
DGM 2021年8月9日
t = 1/get(input1,'Freq');
Input1是一个丢失的变量/对象,因此您必须弄清楚。如果这是别人的代码,那么我的信息比您对此的信息少。
为了[i=0;1;1i
{
% ...
};
I have no idea what language this is from, but it's not MATLAB. I am not familiar with any 4-argument for loop syntax, so I have no idea what the 1 means. You're using i as both an integer index and you're attempting to explicitly use it as a complex number. Both i and j are sqrt(-1). Unless you're using them as that, don't cause problems by overloading them for use as indices or something.
b = wn*t*sqr(1-1/4/q/q);
我假设应该是SQRT()?
y = filter(input1,bb,aa);
同样,我假设Input1是您已经存在的一些变量。
没有丢失的变量,这是我最好的猜测:
CLC;清晰
ymax = [];
ff = [];
fmin = 1;
fmax=1000;
n = 90;
qv =(fmax/fmin)^(1/n);
%t = 1/get(input1,'freq');
t = 1/200;百分比的假号以使其运行
Q = 10;
为了k = 0:n-1% 这是正确的吗?
fn = fmin*qv^k;
ff = [ff,fn];
wn = 2*pi*fn;
a = wn*t/2/q;
b = wn*t*sqrt(1-1/4/q/q);
b0 = 1-exp(-a)*sin(b)/b;
b1 = 2*exp(-a)*(sin(b)/b-cos(b));
b2 = exp(( - 2)*a)-exp(-a)*sin(b)/b;
a1 =( - 2)*exp(( - 1)*a)*cos(b);
a2 = exp(( - 2)*a);
BB = [B0,B1,B2];
aa = [ - a1,-a2];
%y=filter(input1,BB,AA);
y =过滤器(BB,BB,AA);%只是塞进其中的东西,所以它运行
yy = max(y);
ymax = [ymax,yy];
结尾
1条评论
沃尔特·罗伯森(Walter Roberson)
我想知道是否是否
为了[i=0;1;1i
是某种组合
为了i = 0:1:1
和C / C ++
为了(i = 0; i

登录发表评论。

标签

s manbetx 845


Release

R2014A

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

开始狩猎!