I do not understand what PSO is supposed to do here. PSO is an optimization algorithm. What are your control variables, meaning the things you can change? What is your objective function? Answer those questions, and we might have a chance of helping.
Alan Weiss
MATLAB mathematical toolbox documentation