MATLAB: Fopen syntax, a new usage??

fopenMATLABsyntax

i found a usage of fopen which is not found in MATLAB documentations
here is my code
s = 'name';
fileID = fopen([s,'.txt'],'w');
this syntax really works. but i could not found the source.
the ordinary usage of fopen could be
fileID = fopen('name.txt','w')
why?
is MATLAB documentation uncomplete?
thank you!

Best Answer

It’s not so complicated [] is used for concatenation
['name', '.txt'] % try it in command window and see what happens