Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

error in dtft code of matlab

Status
Not open for further replies.

sayurabh

Member level 4
Joined
Apr 11, 2007
Messages
69
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,783
matlab dtft

tell me the error in following dtft matlab code
>> x=rand(1,11);
>> n=1:10;
>> k=0:500;
>>w=(pi/500).*k;
>> X=x*(exp(-j*pi/500)).^(n'*k);
??? Error using ==> *
Inner matrix dimensions must agree.
 

matlab code for dtft

this is because the inner matrix dimensions are not agree:

x is 1x11 and (n'*k) is 10x501. you can arrange this if x is x=rand(1,10) or n=0:10.

with the first case:
x=rand(1,10);
n=1:10;
k=0:500;
w=(pi/500).*k;
X=x*(exp(-j*pi/500)).^(n'*k);
 

    sayurabh

    Points: 2
    Helpful Answer Positive Rating
c code dtft

thanx buddy problem is solvd
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top