Pergunta

I have data = [a b c d] and this data is in a loop, in which a, b, c and d's values change.

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

How can I save the whole data and train it?

Foi útil?

Solução

change your code as the following:

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'. 

By the way, in matlab, the comments are followed by '%'

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top