How to define function or variable 'x'?

19 vues (au cours des 30 derniers jours)
PRATEEK GUPTA
PRATEEK GUPTA le 17 Mai 2017
Modifié(e) : Stephen23 le 17 Mai 2017
I want to write an algorithm for minimizing a function bounded by some constraints (non linear and linear functions) without using the optimization toolbox but some optimization method. I have given the objective function in a 'minimize.m' file and constraint in another 'nonlin.m' and 'lin.m' file. Now as I call the function in my algorithm 'ALU.m' file and try to run, it shows "Undefined function or variable 'x' ". I had given below my algorithm starting part. Please help me where I am doing wrong. I would be very thankful.
fun = @minimize;
G = @nonlin;
H = @lin;
var = input('number of variables= ');
s = input('number of non-linear constraints= ');
u = input('number of linear constraints= ');
i = 1; j = 1; k = 1;
x = sym(x);

Réponses (1)

Stephen23
Stephen23 le 17 Mai 2017
Modifié(e) : Stephen23 le 17 Mai 2017

Catégories

En savoir plus sur Nonlinear Optimization dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by