I am trying to create a swept-frequency cosine, and I want to be able to set the phase as I please. I tried that code, but I get an error. I want to create a vector mat(1:40), where I can manually set its phase.
Fs = 32000;
t = 0: 1/Fs: 10 -1/Fs;
tt = 10;
f1 = 20;
f2 = 250;
cosineph = zeros(1,40);
for iMat= 1:40
mat(iMat) = chirp(t,k*f1,tt,k*f2,'linear',cosineph(iMat));
The error that I am getting is " In an assignment A(I) = B, the number of elements in B and I must be the same."
Now, I am guessing it refers to variable t, so I tried implementing that into an embedded for, but didn't get the results I wanted.