Hi friends,(adsbygoogle = window.adsbygoogle || []).push({});

I wanted a help in Matlab programming. I have some vectors as below :

d4=cos(2*pi*293.665*(0:1/44100:.25));

f4=cos(2*pi*349.228*(0:1/44100:.25));

e4=cos(2*pi*329.628*(0:1/44100:.25));

g4=cos(2*pi*391.995*(0:1/44100:.25));

c5=cos(2*pi*523.251*(0:1/44100:.25));

bb4=cos(2*pi*466.164*(0:1/44100:.25));

a4=cos(2*pi*440*(0:1/44100:.25));

c4=cos(2*pi*261.626*(0:1/44100:.25));

and finally a vector x build from the above vectors :

x=[c4 c4 d4 c4 f4 e4 c4 c4 d4 c4 g4 f4 c4 c4 c5 a4 f4 e4 d4 bb4 bb4 a4 f4 g4 f4];

here a4 must be assigned 1, bb4 - 2, c4 - 3, d4 - 5, e4 - 6 , f4 - 7 and g4 - 8. I wanted to create a vector y from x. y must be as below :

y = [3 3 5 3 7 6 3 3 5 3 8 7 3 3 4 1 7 6 5 2 2 1 7 8 7] ;

TIA

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# How to do this vector operation in MATLAB ?

**Physics Forums | Science Articles, Homework Help, Discussion**