how to do simple loop in maxima and save the result in a file?
Subject: how to do simple loop in maxima and save the result in a file?
From: razif razali
Date: Wed, 20 Apr 2011 10:41:11 +0800
-----------------------------------------
#include <stdio.h>
#include <math.h>
int main()
{
double p, x,y,delt;
int a, Is, g, l, z, d;
FILE *fout;
delt=0.001;
fout = fopen( "test1.dat", "w");
for (x=0.4; x<1; x=x+delt){
p=(1-x)/(1+x);
printf ("%f %f\n",p,x);
fprintf(fout, "%f %f\n",p,x);
}
fclose(fout);
return 0;
}
------------------------------------
above are C script to generate 'test1.dat' file with 'p' value for each
'x',
how can I do similar loop program in Maxima and save the result in a new
file like 'test1.dat'?
i'm read the manual and came across that Maxima result can be converted to
fortran script, is C conversion also available?because I'm not very familiar
with fortran.
--
Regards,
RAZIF RAZALI,
Tutor & Master Student,
Physics Department,
Faculty Of Science,
Universiti Teknologi Malaysia(UTM).
+60199393606