2013-04-01 57 views
1

我有data = [a b c d]这个数据是在一个循环中,其中a,b,cd的值发生变化。如何在MATLAB中训练数据以便在ANFIS中使用?

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

如何保存整个数据并进行训练?

+0

你能不能提供更多的细节?在每个循环中,数据是否根据函数或分布而变化? – tqjustc

+0

yeas, 我改变了我的帖子我想保存包含所有a和b值的“数据”; – Binja

回答

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中的评论之后是“%”

+0

谢谢tqjustc :) – Binja

+0

@Bayanaa不客气。 – tqjustc

相关问题