필터 지우기
필터 지우기

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