MATLAB issue

Thread Starter

jaygatsby

Joined Nov 23, 2011
182
I'm trying to plot the FT of something, so:

y = 30*sinc(5*f)*exp(-j*2*pi*f*2.5)

MATLAB returns the infamous 'inner matrix dimensions must agree' error. I thought I could define the 'f' matrix to be of any length. When I take 'f' out of the exp, but leave it in the sinc(), it works. What doesn't it work when I put the f in the exp as well?

Thanks,
J
 

MrChips

Joined Oct 2, 2009
34,981
When multiplying two vectors you have to be aware of the difference between a vector multiplication (.*) and matrix multiplication (*).

Replace the *exp() with .*exp()
 
Top