如何在MATLAB中训练数据以便在ANFIS中使用?

时间:2013-04-01 04:51:14

标签: matlab neural-network fuzzy-logic

我有data = [a b c d]这个数据是循环的,其中abcd的值会发生变化。

for num=START:END
    [out1 out2] = some_funstion(input_image);
    a = out1+out2;
    b = out2-out1; %example
    data = [a b];
end

如何保存整个数据并对其进行培训?

1 个答案:

答案 0 :(得分:2)

按以下方式更改您的代码:

data = [];
for num=START:END
    [out1 out2] = some_funstion(input_image);
    a = out1+out2;
    b = out2-out1;%example
    data = [data; a b]; % each row of data will be a and b
end

save('file.mat','data'); % save 'data' in the 'file.mat' file
load('file.mat'); % load 'data' from 'file.mat'. 

顺便说一句,在matlab中,注释后跟'%'