Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortan snippet conversion to C, C++ or C#

Status
Not open for further replies.

bluenut

Programmer
Dec 27, 2004
6
I ran accross this piece of code with what appears to be range notation which I need to convert to C.

beta = 0:2*pi/Np:2*pi;
xc = 0.5*(1+cos(beta));
yt = acoef(1)*sqrt(xc)+xc.*(acoef(2)+xc.*(acoef(3)+xc.*(acoef(4)+acoef(5)*xc)));
yt(Np/2+2:Np+1) = -yt(Np/2:-1:1);

* Np is interger
* acoef array of coefficients.
* beta, xc, yt arrays

Any ideas would be appreciated.
 
Which version of Fortran are you using? Some of the syntax is incorrect in both F77 and F90. I don't know about F95.

 
I'm trying to convert this snippet to C#. I believe the snippet was written for a MatLab system. I got the code from this url:
Thanks for your interest, but dont spend a lot of time on this. I got into this because I thought this to be an interesting excercise as the code is a baffle to me as it appears to be part Fortarn and part APL?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top