You may use ActiveX to add borders in excel using matlab. Following
is the sample matlab code.
%%%%%%
Excel = actXserver('Excel.Application');
set(Excel, 'Visible', 1);
wrkBooks = get(Excel, 'WorkBooks');
invoke(wrkBooks, 'Add');
wrkSheet = get(Excel, 'ActiveSheet');
range = invoke(wrkSheet, 'Range', 'B10:G20');
borders = get(range, 'Borders');
set(borders, 'ColorIndex', 3);
set(borders, 'LineStyle', 9);
%%%%%%
-Vadivelu M
===========
borders is a collections of all. if you want, you can set one
particular border as,
my_border = get(borders, 'Item', <item>);
set(my_border, 'ColorIndex', 3);
set(my_border, 'LineStyle', 9);
where, <item> can be,
1 - all vertical but not rightmost
2 - all vertical but not leftmost
3 - all horizontal but not bottommost
4 - all horizontal but not topmost
5 - all diagonal down
6 - all diagonal up
7 - leftmost only
8 - topmost only
9 - bottommost only
10 - rightmost only
11 - all inner vertical
12 - all inner horizontal
so, you can choose your own side.
-Vadivelu M
===========
All lines of my sample code works fine in R13. To work in R12, please
change the line range = ... to,
range = get(wrkSheet, 'Range', 'B10:G20');
-Vadivelu M
===========