# ??? undefined function or method 'ga14bus_29_sep_2018' for input arguments of type 'double'.

조회 수: 1 (최근 30일)
tahseen alshmary 2018년 9월 30일
댓글: Walter Roberson 2018년 9월 30일
??? undefined function or method 'ga14bus_29_sep_2018' for input arguments of type 'double'.
dear sirs how can i solve this problem in matlab 2009b
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Walter Roberson 2018년 9월 30일
Note: you marked the question has having to do with Extended Symbolic Math Toolbox, which was a toolbox that was no longer available in the MATLAB release you indicate you are using, R2009b.
You do not appear to be using any function from the Extended Symbolic Math Toolbox: generally speaking those would show up as calls to maple() or evalin(symengine) or feval(symengine)

댓글을 달려면 로그인하십시오.

### 답변 (1개)

tahseen alshmary 2018년 9월 30일
편집: Walter Roberson 2018년 9월 30일
```clf
clc
clear
close all
mr_max =10;
miscoord =[];
dt_run =[];
fitrecrun =[];
f1bestrecrun =[];
f2bestrecrun =[];
f3bestrecrun =[];
mr_bestever =inf;
good_dt =0;
good_ub =0;
good_lb =0;
good_dt_lb_ub =0;
TMbestrec =[];
for mr =1:mr_max
end
%A setup the GA
ff ='ga14bus'; %objective function
npar  =42;  % number of optimazation variables
varhi =1.0; % varible limit
varlo =0.01;% varible limit
%_____________________________________________________________________
```
```      % B stopping criteria
maxit = 1500;            % max number of iteration
mincost =-9999999;       % minimum cost
%______________________________________________________________________```
`      % C GA parameter `
```      popsize = 100;                   % set population size
mutrate = 0.02;                  % set mutation rate
selection = 0.5;                 % fraction of population kept
Nt  = npar;                      % continuous parameter GA Nt=#variables
keep = floor(selection*popsize); % # population members that survive
nmut = ceil((popsize-1)*Nt*mutrate); %total number of mutations
M  = ceil((popsize-keep)/2);      % number of mating ```
`     %______________________________________________________________________`
```     % Creat the intial population
iga    = 0;                      % generation counter
par    = (varhi-varlo)*rand(popsize,npar)+varlo;  % random
% make the variable discrete before evaluation ```
```     temp_par    = size(par);
row_par     = temp_par(1);
col_par     = temp_par(2);
for i= 1:row_par
for j = 1:col_par
if mod(par(i,j),0.01)<1e-10
par(i,j)   =par(i,j);
else
par(i,j) =(ceil(par(i,j))/0.01)*0.01;
end
end
end
cost     = ga14bus_29_Sep_2018(par);    % calculates population cost using objective function
[cost,ind] = sort(cost);            % min cost in element 1
par        = par(ind,:);            % sort continuous
minc(1)    = min(cost);             % minc contains min of population cost
meanc(1) = mean(cost);              % meanc contains mean of population cost
fitrec   = [];```
##### 댓글 수: 4이전 댓글 2개 표시이전 댓글 2개 숨기기
tahseen alshmary 2018년 9월 30일
how can i define it
Walter Roberson 2018년 9월 30일
function cost = ga14bus_29_Sep_2018(par)
cost = randn(size(par));

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by