Extracting data from structures to create a table and export to latex
    2 views (last 30 days)
  
       Show older comments
    
Dear all, I have a structure object wich is exemplary called mean.usa.gdp, the second level (.usa) has 24 entries, the third level (.gdp) has 3 entries.
which I created in a loop:
if true
Var = {'CGV','GDPV','REGIME'};
nv  = length(Var);
Countries =  {'usa','jap','ger',...,'slo'};   
nc  = length(Countries);
  for ii=1:nc
for jj=1:nv
    eval(['lengths.' Countries{ii} '.' Var{jj} '= length(find(isnan(countrydata.' Countries{ii} '.' Var{jj} ')==0))']);
end
end
end
Now I would like to create a table with the list of countries on the horizontal and the variables on the vertical,
Something like:
       usa | jap | ger | ...
GDPV   ... | ... | ... | ...
CGV    ... | ... | ... | ...
REGIME ... | ... | ... | ...
and I would like to export this table to Latex directly. Any help here would be greatly appreciated!
Best, Philipp
2 Comments
  Sasha Egan
 on 22 Nov 2018
				I've been waiting over four years for an answer to this question. I asked it my freshman year in college and I have since graduated. Does anyone know how to export tables from matlab to latex without resorting to dlmwrite or writetable with a delimiter and then replace the delimeter with &'s, is there any way to specifiy a custom delimeter?
Answers (0)
See Also
Categories
				Find more on LaTeX in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

