SDT-base         Contents     Functions         Previous Next     PDF Index

vhandle.tab

Purpose

Class constructor for SDT name tab handle objects.

Description

This is used to generate tabular output of the cell array tt to various supported types : Tab (opens a java tab containing the table), excel (Microsoft Excel only available on windows), html, csv (comma separated values, readable by excel), tex (latex formatting), text printout to the command window.

 % A sample table
 tabdata=num2cell(reshape(1:10,[],2));
 tab=vhandle.tab(tabdata)
 tab.ColumnName={'c1','c2' % Name
  '',''  % cell formating
  '%3i','%.1f'} % Column formating 
 tab.name='TestTab' % tab name in a TabbedPane
 asTab(tab,'SDT Root') % Show as java table in 'SDT Root' figure
 
 
 tname=nas2up('tempname o.html'); 
 % RO option structure to format a table for HTML or java output
 RO=struct('fmt',{{'%3i','%.1f'}}, ... % Formatting for each column
    'HasHead',1); % a header is provided as strings
 RO.fopen={tname,'a+'};  % Opening information 
 RO.OpenOnExit=0;
 RO.Legend=sprintf('<p>%s</p>','My HTML legend');
 asHtml(tab,RO) % was  comstr(tab,-17,'html',RO);
 sdtweb('_link',sprintf('web(''%s'')',tname))
 
  % Generate tex output of java tabs
 comstr(struct('FigTag','SDT Root'),-17,'tex');

Accepted fields for the options structure are

Fields specific for HTML generation are

Fields specific for JAVA tabs are


©1991-2024 by SDTools
Previous Up Next