February 9th, 2007, 9:40 am
Hi I am trying to maximise log likelihood function of 5 parameters using fmincon, with constraints on two of its parameters which I provide using confun . As far as I can see , I am doing it as Matlab help suggests, but I am getting an error message , " conversion to struct from double is not possible" ........Main file.............clear all;P = [3.59 0.00633966 0.088 0.068493151 0.010678]options = optimset('LargeScale','off');[PP, fval] = fmincon('mrbjlikepower',P,[],[],[],[],'confun',options);..........Constraints....................function [cin, ceq] = confun(P)cin = [-P(1) + 3 ; - P(2) ; P(2) - 5];ceq = [];I am just begginning to write programs in matlab so can't figure out what this means.Any suggestions on how to rectify this , would be very much appreciated .Thanks.MF
Last edited by
MF01 on February 10th, 2007, 11:00 pm, edited 1 time in total.