I have a excel dataset which I want to train first and then apply PSO technique to find the best output value from the trained dataset. Can anyone provide me the methodology or codes?
I think that the function is constituted by some discrete points, not a continuous functions. In that case, you must convert that to a continuous function, using interp1(). You can find a similar question about this: https://www.mathworks.com/matlabcentral/answers/56545-convert-x-y-data-into-a-function-y-f-x
You can also find for Hermite Interpolation method.
Then, you have a function f. Now, you are able to use PSO method with that function.