1

我有data = [a b c d]并且这些数据在一个循环中,其中、a和的值会发生变化。bcd

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

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

4

1 回答 1

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中,注释后面是'%'

于 2013-04-01T05:57:30.213 回答