It might help if I restate my question. What I am asking for is a way to produce the same result programatically that I can get by doing the following manually:
- Call disp(myTable) to display the table in the command line interface.
- Select the displayed lines and copy them to the system clipboard.
- Paste the copied lines to my text file.
Here is an example of what this looks like at the command line:
>> T = table([1:5]',[10:10:50]','VariableNames',{'Var_A','Var_B'});
>> disp(T)
Var_A Var_B
_____ _____
1 10
2 20
3 30
4 40
5 50
I can simply select the lines that display the table contents and copy them to my file to get exactly what I want.
Walter Roberson suggested in his answer that I try using evalc('disp(T)'), which gives me something close to what I want, but it includes markup code (for boldface), as below:
<strong>Var_A</strong><strong> Var_B</strong>
<strong>_____</strong> <strong>_____</strong>
1 10
2 20
3 30
4 40
5 50
I hope that clears up what I'm asking.