Hi All(adsbygoogle = window.adsbygoogle || []).push({});

I am new with Matlab

I am trying to write a function on an M-file; here is the script:

function f = ali(x)

f = - x(1) * x(2);

A = [-1 -2 -2; 1 2 2]

b = [0; 72]

x0 = [10; 10; 10];

[x,fval] = fmincon(@ali,x0,A,b)

Whenever i run it i get the following message;

input argument "x" is undefined

So can anybody help

Best Regards

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab I am trying to write a function on an M-file

Loading...

Similar Threads - Matlab trying write | Date |
---|---|

How to program this in Matlab | Feb 28, 2018 |

How to compute a tri-coherence | Jun 30, 2014 |

Having difficult time trying to plot a simple trajecory | May 30, 2014 |

MATLAB: Trying to understand a MATLAB .m file | Apr 3, 2011 |

MATLAB 2010a surf bug? Can someone try to replicate? | Oct 25, 2010 |

**Physics Forums - The Fusion of Science and Community**