How to generate table

I want to generate output table as below:
All table lines are "dotted lines"
JAK 23 KMT 56 89 45 JKA 23
VABH 45 BZX 12 56 45 BNA 23
VAM10 58 KRN 45 89 12 LR 89
YTH23 56 KR 25 29 0 HRY 18
HAY 48 SRT 120 163 12 ALK 17

Respuestas (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 16 de Mayo de 2019

0 votos

Hi,
Here are two different solutions giving the same table output:
% Solution 1
TT= { 'JAK' 23 'KMT' 56 89 45 'JKA' 23 ;
'VABH' 45 'BZX' 12 56 45 'BNA' 23 ;
'VAM10' 58 'KRN' 45 89 12 'LR' 89 ;
'YTH23' 56 'KR' 25 29 0 'HRY' 18 ;
'HAY' 48 'SRT' 120 163 12 'ALK' 17 };
TAB_T=cell2table(TT, 'variableNames', {'Name', 'Age', 'District', 'Start', 'End', 'Group1', 'Group2', 'Group3'});
%% Solution 2
Name={ 'JAK'; 'VABH' ;'VAM10' ; 'YTH23' ; 'HAY' };
Age=[23; 45; 58; 56; 48];
District={'KMT' ; 'BZX'; 'KRN' ; 'KR' ; 'SRT' };
Start = [56;12;45;25;120];
End= [89;56;89;29;163];
Group1=[45;45;12;0;12];
Group2 = { 'JKA' ;'BNA' ; 'LR' ; 'HRY'; 'ALK' };
Group3 = [23;23;89;18;17];
TTT = table(Name, Age, District, Start, End, Group1, Group2, Group3);
Good luck.

1 comentario

Mekala balaji
Mekala balaji el 17 de Mayo de 2019
I wan to have dotted line columns like below:
_ _ _ _ _ _ _ _ _ _ _
A | B | C |
4 | 2 | ManaK |
8 | 6 | JKAL_67 |
9 | 5 | VABHK |
6 | 9 | JKLAO |
10 | 10 | KLAOp90 |
_ _ _ _ _ _ _ _ _ _ _

Iniciar sesión para comentar.

Categorías

Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 14 de Mayo de 2019

Comentada:

el 17 de Mayo de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by