문제

I have two arrays of the same length in IDL. I want to combine the two arrays pairwise so that I can then print the two arrays as columns to file. Is this possible?

도움이 되었습니까?

해결책

You can combine two arrays (with same length n) like this :

combined = [[array1], [array2]]

so that combined is n x 2.

Although you can write your data without creating a third array:

openw, lun, 'path_to_file.ext', /get_lun
foreach elem, array1, index do begin
  printf, lun, elem, array2[index]
endforeach
free_lun, lun
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top