MATLAB: Solving equation involving trigonometry matrices with different row and column

matrix manipulation

Hello there
Im having problem write a program to solve these equation e[sin(f*(g-h))] where the value of matrix are different in row and column where 'e','f' and 'g' are 6 by 1 while 'h' is 1 by 6 matrix, for example
e=[1;2;3;4;5;6] f=[1;2;3;4;5;6] g=[1;2;3;4;5;6] h=[1 2 3 4 5 6]
e[sin(f*(g-h))]
kindly request anyone to help me. Thanx

Best Answer

Rahimi, use
e.*sin(f.*(g - h'))
To do element-wise multiplication you need to use the .* operator, the prime ' turns a row into a column vector, and vice versa.