You can apply PSO to data matrices such as are created when you imread() an image.
Well, from the description of Particle Swarm Optimization http://en.wikipedia.org/wiki/Particle_swarm_optimization, it appears that you need to have a function that you want to optimize. There's not just one formula that applies to all PSO situations. Have you checked the File Exchange?
Play games and win prizes!Learn more