Problem in reading the variable in Function file.
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Image Analyst
2013년 2월 15일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!