MATLAB: How to find argmin to this vector #argmin-vector c=argmin f(a,b).where both a,b are M*1 and N*1 column matrices respectively. How to get a,b for minimum value of f(a,b) from matlab Best Answer Are you looking for something like this? Let a,b be your column matrices. [a,b] = meshgrid(a,b) ; % make them a matrix F = f(a,b) ; % evaluate your function, use element by element operations in f [val,idx] = min(F(:)) ; amin = a(idx) ; bmin = b(idx) ; Have a look on fmincon. Related SolutionsMATLAB: How to find maximum before a certain element in the matrix B=[5 8 5 2 6 9 10] ; [~,ind] = min(B); maxB4min = max(B(1:ind)) =8 MATLAB: Find the element in matrix of intersecting vectors attainedA=( max(a,[],1)==a ); attainedB=( max(b,[],2)==b ); result = c(attainedA & attainedB) Related QuestionArgmin of a vectorPlz i need help to make this , thank uMatlab fuction maximum and minimumFind the Argmin of a vectorHow to compare vector`s values
Best Answer