Converting matlab to C - matrix operator

3 次查看(过去 30 天)
Alex
Alex 2011-8-15
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by