how to save mutiple files where each file store output of NN train method?
1 view (last 30 days)
Show older comments
for i=1:20
% some stuff for net, P and T
var= train(net,P,T);
currentFile = sprintf('var_%d.mat',i);
save(currentFile,'var');
end
files are made with common variable names and thus problem in loading the files in different scripts for sim method.
Thanks in advance!
0 Comments
Accepted Answer
Walter Roberson
on 3 Dec 2013
That code should be fine for writing different files, each of which has the save variable name "var".
If you want to load multiple "var" into the same MATLAB session, instead of using
load('var_9.mat')
(for example), use
var = cell(20,1);
for i = 1 : 20
currentFile = sprintf('var_%d.mat', i);
T = load(currentfile);
var{i} = T.var;
end
The result would be cell array, var, with var{9} containing the values from var_9.mat (for example)
More Answers (0)
See Also
Categories
Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!