余弦累加函数作图问题。

4 Ansichten (letzte 30 Tage)
果博东方开户联系【微8785092】
a=-pi/4:pi/999:pi/4;
n=2:2:1000;
y1=0.3/sum((cos(n.*(pi/9))./((n.^2-1).^2))).*sum(cos(n.*(pi/9)).*cos(n.*a)./((n.^2-1).^2));
plot(a,y1);
这个求出来y1只有一个结果,图像是空的,是缺了循环吗?

Akzeptierte Antwort

果博东方注册开户【微8785092】
a=-pi/4:pi/999:pi/4;
n=2:2:1000;
for ii = 1:length(a)
y1(ii)=0.3/sum((cos(n.*(pi/9))./((n.^2-1).^2))).*sum(cos(n.*(pi/9)).*cos(n.*a(ii))./((n.^2-1).^2));
end
plot(a,y1);

Weitere Antworten (0)

Kategorien

Mehr zu Logical finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!