Printing a LaTeX Table with Some Number and some Words
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Michael
le 22 Oct 2013
Commenté : Kelly Kearney
le 23 Oct 2013
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!
0 commentaires
Réponse acceptée
Kelly Kearney
le 22 Oct 2013
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{:})
2 commentaires
Kelly Kearney
le 23 Oct 2013
Same basic idea:
data = [sDetNamesGe' num2cell(TFWL_pos_det)]';
sprintf('%s & %.2f & %.2f & %.2f \\\\\n', data{:})
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur LaTeX dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!