Code:
function [ak] = myNF(A,B,T,N)
n=0:1:N-1
ak=myDTFS1(A*cos(25*n*T)+B*cos(5*n*T)); %Part 3A
akmag=abs(ak)
figure
plot(n,akmag) %part e,1
hold on
title('n,asjdf;lkajds;flkajd;sfkajsd;flkjadfak');
hold off
%figure
%plot(n,akmag)
%hold on
%title('n,ak2');
%hold off
kk=myCONVLin(A*cos(25*n*T)+B*cos(5*n*T),n*T) %Part 3B
figure
plot(n,kk)
hold on
title('n,kk');
hold off
a=1:1:50;
q=1:1:50;
X(q)=A*cos(25*q*T)+B*cos(5*q*T) %Part 3C
X(q+a*N) = X(q); %makes it periodic
%H(n+a*N) = H(n); %makes it periodic
bk=myDTFS1(A*cos(25*n*T)+B*cos(5*n*T));
bkmag=abs(bk)
figure
plot(n,bkmag)
hold on
title('n,bk');
hold off
end
So, the function is supposed to make 3 plots. n,asjdf;lkajds;flkajd;sfkajsd;flkjadfak n,kk and n,bk.
The n,kk and n,bk plots are working perfectly. however the n,asj.... plot is not showing up. Instead, its this weird plot that I dont know what it is.
However, if i try to plot ak2, the function will give me 4 plots. The n,kk plot, the n,bk plot, the n,adjdf... plot and once again the weird plot that i dont understand. The function is NOT giving me the ak2 plot.
Here is the myDTFS1 code:
function [c] = myDTFS1(f)
syms j k w n;
N=length(f); %takes in the length of the vector
c = zeros(1,N); %sets the values of the matrix to 0
a=exp(-1i*(2*pi)/N); %part of the analysis equation to make it easier to compute.
for n=1:N
for k=1:N
x=(1/N)*f(n)*(a.^((n-1)*(k-1))); %n-1 and k-1 is a way to get around matlab not taking in 0's.
c(k)=c(k)+x;
end
end
end
as you can see, no plots should be made in mydtfs1 function. Any ideas?

댓글 수: 1

Image Analyst
Image Analyst 2014년 11월 24일
Please supply values for A,B,T,N so we can call your function.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

2014년 11월 23일

댓글:

2014년 11월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by