grid search for parameter values

Dear all, I would be very thankful for an advice! I have a code for an open economy model, with 6 parameters, and I need to perform a grid search for this parameters. I am just starting to use Dynare and absolutely unclear how to build the loop for the parameters search. I thought to write and external matlab file, but may be there is a better way? Would be very thankful for suggestions or/and examples!! Thanks a lot in advance!