Iterating over a list of strings in MATLAB
str={'aaa','bbb'};
fprintf('%s\n',str{:});
No need for for
loops.
EDIT:
See also: cellfun
You should call the cell's content via str{1}
as follows to make it correct:
for str = {'aaa','bbb'}
fprintf('%s\n',str{1});
end
Here's a more sophisticated example on printing contents of cell arrays.
Starting with R2016b you can use string arrays:
for str = ["aaa" "bbb"]
fprintf('%s\n',str);
end