我有data = [a b c d]
这个数据是循环的,其中a
,b
,c
和d
的值会发生变化。
for num=START:END
[out1 out2] = some_funstion(input_image);
a = out1+out2;
b = out2-out1; %example
data = [a b];
end
如何保存整个数据并对其进行培训?
答案 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中,注释后跟'%'