You can concatenate strings using strcat
. If you plan on concatenating numbers as strings, you must first use num2str
to convert the numbers to strings.
Also, strings can't be stored in a vector or matrix, so f
must be defined as a cell array, and must be indexed using {
and }
(instead of normal round brackets).
f = cell(N, 1);
for i=1:N
f{i} = strcat('f', num2str(i));
end