tic global sig long short c_thd r_thd t_thd b_thd; # these are the loop iteration vars short_min = 5; short_max = 10; short_st = 1; long_min = 20; long_max = 40; long_st = 1; sig_min = 5; sig_max = 12; sig_st = 1; c_thd_min = -3; c_thd_max = -5; c_thd_st = -1; r_thd_min = 1; r_thd_max = 3; r_thd_st = 1; t_thd_min = 1; t_thd_max = 3; t_thd_st = 1; b_thd_min = 0; b_thd_max = -2; b_thd_st = -1; outfile = "foo" ; mx_actg = 0 ; ## So later if always executes ## Schmoo variables, calling function "analyze" for each data point for sig = sig_min : sig_st : sig_max for long = long_min : long_st : long_max for short = short_min : short_st : short_max if short <= long ## which it should be, but just checking for c_thd = c_thd_min : c_thd_st : c_thd_max for r_thd = r_thd_min : r_thd_st : r_thd_max for t_thd = t_thd_min : t_thd_st : t_thd_max for b_thd = b_thd_min : b_thd_st : b_thd_max ## Call function analyze, which uses global iteration vars to operate on several global vectors [c_cntr b_cntr s_cntr avg val actg ddown pk_ddown] = analyze(outfile); if actg > mx_actg mx_short = short; mx_long = long; mx_sig = sig; mx_c_thd = c_thd; mx_r_thd = r_thd; mx_t_thd = t_thd; mx_b_thd = b_thd; endif endfor endfor endfor endfor endif endfor endfor endfor toc