我有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
如何保存整个数据并进行训练?
我有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
如何保存整个数据并进行训练?
更改您的代码如下:
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中,注释后面是'%'