I am having problems with the below code. It is a

I am having problems with the below code. It is a variation of an example listed in the optimization chapter of the Modelling and Simuation in Scilab-Scicos book (pages 109-110 & 114). I can configure the code to work for leastsq and lsqrsolve, but not fmincon from the FOSSEE Optimization toolbox.

All worked examples that call fmincon listed on the FOSSEE site run without problem. These include all 7 examples in 'documentation' plus the spring and circular tank design problems in 'examples'.

The problem has been presented to the Scilab.org comminity and the code syntax checked for potential problems. It complies with the FOSSEE toolbox syntax in both a short and long call with derivative.

How may i configure the least-squares problem to be solved with a call to fmincon?
Any help to resolve the matter would be greatly appreciated.

My system is: Windows 10 Home 64-bit OS, Intel core i5 x64-based processor, Scilab 5.5.2

Regards, Dave

function z=fun(p)
function dz=dfun(p)
function f=costf(p)
f = norm(fun(p))^2;
function g=grad(p)
g = 2*dfun(p)'*fun(p);

DAT=[0 0;0 1;1 1;2 1.5;2 2];
p0=[0 0 0];

xopt = fmincon(costf,p0,[],[])
options = list("GradObj",grad)
xopt = fmincon(costf,p0,[],[],[],[],[],[],[],options)

Scilab Toolbox Optimization Toolbox 14-01-20, 8:17 p.m. brant

It's great that here you can find so much information and materials that can help in job. But it'll be just as great to just fix my problems in my personal life. My friend recommended this chat to me and this is exactly what I need https://isexychat.com/chatrooms/teen-chat/ I hope this will help me forget about my problems and bring at least some variety into my life.

27-12-21, 10:47 p.m. ClydeJohnson

Foodle is a word-guessing game for those who love or have knowledge of food. The game only offers one puzzle per day and challenges players all over the world. Each player will have a total of 6 guesses to find a mysterious 5-letter word. Clues will appear through each guess if matching letters appear. Players can rely on the color of the tiles to make the next guess.
All Foodle mystery words are on the subject of food. Therefore, providing you have a rich vocabulary on it, you already have an edge to win. Just think of food throughout the game to find the answer. In addition, the Settings menu in Foodle gives players the option to play the game in Color Blind Mode, which employs high contrast colors. Thanks to this, people with color or vision impairments can also recognize color-coded tiles.
All of the letters in the hidden word will become green in default mode after you find it. There will be no more challenges for the day, and you'll have to wait till the next one comes along.
04-07-22, 3 p.m. chunmin89

Calling all Naruto fans! Elevate your ninja skills with Naruto Senki MOD APK. Unleash powerful jutsus, unlock exclusive characters, and embark on epic battles in the Naruto universe. Download now and immerse yourself in the thrilling world of Naruto like never before. Get ready for an action-packed adventure!
05-07-23, 7:08 p.m. Anosha

Log-in to answer to this question.