too many input arguments. matlab

来源:百度知道 编辑:UC知道 时间:2024/06/17 21:20:16
function [X,FVAL,REASON,OUTPUT,POPULATION,SCORES] = zuiyou
%% This is an auto generated M file to do optimization with the Genetic Algorithm and
% Direct Search Toolbox. Use GAOPTIMSET for default GA options structure.
int c(8,8)={{0,12,14,10,20,25,27,18 },{12,0,5,13,6,14,41,39},{14,5,0,16,18,20,30,32},{10,13,16,0,14,27,15,12},{20,6,18,14,0,22,18,26},{25,14,20,27,22,0,27,32},{27,41,30,15,18,27,0,15},{18,39,32,12,26,32,15,0}}
int X(8,8);
int popsize;
int chromlength;
% #include<stdlib.h>
% #include <stdio.h>
%
% {
% int i,j;
% srand((int)time(0));
%
% for(i=0;i<10;i++)
% {
% j=rand()%2;
%

你调用某个函数的时候,给的变量比较多,举个例子

function a=fun(b)

这个函数只能接受一个变量b,如果你这样用fun(1,2)肯定就会报错了。

突然份额发