File Output in IDL [message #55668] |
Tue, 28 August 2007 08:36 |
incognito.me
Messages: 16 Registered: August 2007
|
Junior Member |
|
|
Hallo everyone,
I'm trying to generate a random array (nxn) that should be output as a
file with .txt extension.
The File should also begins with a five line header.
The problem is that for row and column number greater than 7 the
output is all mixed up.
My code looks like this:
Pro GenerateData,nrow,ncol,nheader
header=strarr(nheader)
header[0]='Results'
header[1]=string(string(9b))
header[2]=string(string(9b))
header[3]=string(format='("Row=",I2)',nrow)+string(string(9b))$
+string(format='("Col=",I2)',ncol)
header[4]=string(string(9b))
S=randomn(seed,ncol,nrow)
get_lun,unit
openw,unit,'mydata'+'.txt'
printf,unit,header[0]
printf,unit,header[1]
printf,unit,header[2]
printf,unit,header[3]
printf,unit,header[4]
printf,unit,S
close,unit
end
I guess I'm probably missing a for loop before I print the array but
I'm not sure.Does
someone have an idea?
Thanks
|
|
|