Prev: Plot in Uipanel problem
Next: Saving brightened images
From: Paul on 23 Jul 2010 16:04 If I am using a loop to load several data files, each of which consist of a 100x3 matrix, can I assign each matrix as part of an array? files=dir('input*') for i=1:length(files) data=load(files(i).name); end is what I have, but if I cannot change data to data(i) in an attempt to assign each matrix as it loops. Any ideas on the proper way to do this? Thanks!
From: Walter Roberson on 23 Jul 2010 16:10 Paul wrote: > If I am using a loop to load several data files, each of which consist > of a 100x3 matrix, can I assign each matrix as part of an array? > > files=dir('input*') > for i=1:length(files) > data=load(files(i).name); > end > > is what I have, but if I cannot change data to data(i) in an attempt to > assign each matrix as it loops. > > Any ideas on the proper way to do this? Thanks! Cell arrays. numfiles = length(files); data = cell(numfiles,1); for i = 1 : numfiles data{i} = load(files(i).name); end
|
Pages: 1 Prev: Plot in Uipanel problem Next: Saving brightened images |