Converting matlab to C - matrix operator
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Numeric Types finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!