MATLAB: Printing a LaTeX Table with Some Number and some Words

formattinglatexmatrixstringtable

I have a string:
sDetNamesGe = {'T1Z2', 'T1Z5', 'T2Z3','T2Z5', 'T3Z2','T3Z4',...
'T3Z5','T3Z6', 'T4Z2', 'T4Z4', 'T4Z5','T4Z6', 'T5Z4', 'T5Z5'};
and I have a matrix and I know how to concatenate them…but I want the results to print in a LaTeX table something like:
T1Z2 & matelem11 & ... \\
T1Z5 & matelem12 & ...\\
I think you get the picture. IS there a quick way to force string to print when using latex()? What might you do to print letters and numbers in a tex'd up table such as the one above?
Thanks for your time!

Best Answer

You mean like this?
sDetNamesGe = {'T1Z2', 'T1Z5', 'T2Z3','T2Z5', 'T3Z2','T3Z4',...
'T3Z5','T3Z6', 'T4Z2', 'T4Z4', 'T4Z5','T4Z6', 'T5Z4', 'T5Z5'};
data = [sDetNamesGe; num2cell(1:length(sDetNamesGe))];
sprintf('%s & matelem%d \\\\\n', data{:})