MATLAB: How to use ga optimization function with 3 variables (2 cell arrays, 1 array of different dimensions)

gamultipleoptimizationvariables

Hello,
I am generally new to matlab's optimization toolbox and I am trying to optimize a function which has as arguments 3 variables of different sizes and types. To be more specific, for the first 2 variables I am trying to use a cell array (1,5) whose cells has (2,5) arrays and for the third one I am trying to use an array (3,5). I have a problem declaring the following:
1. the number of variables of the problem.
2. the upper bound and lower bound matrices and
3. the way the objective function and the constraints take them as arguments, for example if F the objective function do I have to write:
``function y = F(x,y,z) % where x = the first cell array, y the second one and z the (3,5) array?``
`` function f = myfitness(x) x1 = x(1:5*2*5); y = x(5*2*5+1:2*5*2*5); z = x(2*5*2*5+1:end); x1 = reshape(x1,5,2,5) y = reshape(y,5,2,5); z = reshape(z,3,5); % Now compute the fitness using x1, y, and z ... end``