MATLAB: How do you write the equation f=exp(x)*cos(x)

function

how do you write the equation f=exp(x)*cos(x)? it is saying that the inner matrix dimensions must agree

Best Answer

I am guessing you want to use the element-wise multiply operator, which has the dot:
f = exp(x) .* cos(x);
Related Question