Is it possibe to create an array of strings in MATLAB within a for loop?
For example,
for i=1:10 Names(i)='Sample Text'; end
I don't seem to be able to do it this way.
You need to use cell-arrays:
names = cell(10,1); for i=1:10 names{i} = ['Sample Text ' num2str(i)]; end
1.4m articles
1.4m replys
5 comments
57.0k users