Converting matlab to C - matrix operator

1 view (last 30 days)
Alex
Alex on 15 Aug 2011
Hi I am trying to convert the following lines of code into C, but I am not completely sure what the matlab operator is actually doing here:
x = (exp(a*2*pi)-cosh(a*b*T0))./sinh(a*b*T0);
c1 = b^2*(x.^2-1);
f = sum(abs(c1.*exp(-2*a*theta_f)+nu*((1+0.5*(4*a^2+1))*cos(theta_f+phi)-2*a*sin(theta_f+phi))+b^2-wf2));
T0 is a column vector 23 long. So I think on the x line, matlab is just doing the calculation using every value of T0 and producing 23 values for x - one for each T0. c1 line is the then producing a vector c1 also 23 long from the vector x. Then f is also producing 23 values, however it takes the absolute then sums them? is this correct? because it also produces a number if i take all the '.' out

Answers (0)

Categories

Find more on Numeric Types in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!