I am trying to minimize a 5 variable function with fminsearch. I only want to minimize the function for two variables. I have tried the following, without luck:
func = @(x,b) myfunction( x, y, z, a, b );
fminsearch(func,[x0,b0]);
x is a matrix of NxM dimensions, and b with YxZ dimensions, so different dimensions. Same for the starting conditions x0 and b0.
I have seen some similar questions asked, but still I cant solve this problem.
I get the following output when running the script:
Error using horzcat
Dimensions of matrices being concatenated are not consistent.