Problem in reading the variable in Function file.
3 views (last 30 days)
Show older comments
I am running a program on Genetic algorithm in MATLAB, for which I have written two function files for Constraint function & Objective function. For which I am reading a set of data from a excel file by following command.
As = xlsread('Steel Table','I1:I66');
Then reading it in function file by following command.
function [c ceq] = optim_cost_var4_const(x)
As = x(1);
But when I am ruining the program following error message is displayed.
??? Input argument "x" is undefined.
Error in ==> optim_cost_var4_const at 2
As = x(1);
I have also tried by assigning the variable as global still its not working. Please help me out.
0 Comments
Answers (1)
Image Analyst
on 15 Feb 2013
Well what did you pass in to optim_cost_var4_const() when you called it???? Let's see the line where you actually call/execute the optim_cost_var4_const() function so we can see what variable you're passing in to it (if any).
0 Comments
See Also
Categories
Find more on MATLAB Report Generator in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!