"PLH " <paulhalkyard@googlemail.com> wrote in message <ibb6g8$7ii$1@fred.mathworks.com>...
> I should probably just redirect you to another post, but since it looks like one of those rare occasions where this is something I can answer...
>
> I'm presuming that F0 is a scalar and that t is a vector? If you have Nf=50 frequencies (Nf values of F0, essentially) at Nt times points (Nt values of t) then you need a NxM matrix to store the data. Here, x looks like a 1X50, which isn't going to hack it.
>
> Try something like:
> tf = 1;dt = 0.01;
> t = 0:dt:tf;
> f = 1:50;
>
> [T,F] = meshgrid(t,f);
> X = sin(F.*T*2*pi);
>
> plot(t,X(6,:)) % plot 6th harmonic
>
> Then, the nth row of X should be the nth harmonic. Is that what you were after?
One slight nit to pick.
[T,F]=meshgrid(f,t)
will give column vectors for the harmonics. Column vectors are more natural for multichannel processing in Matlab.
