I would like to loop over array variables and compute analysis results and store in a CSV file.
Example: I would like to loop over 4 field points and compute MTF and store the results in a CSV file. Where, Column 1 = Frequency, Column 2 = Field 1 results, Column 3 = Field 2 results and so on. How can I append results for the different fields points as defined in the ARRAY?
ARRAY= [1, 2, 3, 4]
FOREACH VARIABLE IN ARRAY
    FOR i = 0, 180, 10
            ! Define variables
            freq = i
            wave = 1
            field = VARIABLE
            sampling = 1
            vector = 1
            type = 1    
            GETMTF freq, wave, field, sampling, vector, type
            FORMAT 10.7
            OUTPUT log_filename$, append
           ! PRINT i, “,”, “vec1(0), “,”, vec1(1) # append results for the different fields as defined in the array
           OUTPUT screen       
    NEXT
Thanks
