MATLAB Answers

(stop) Wrapping output when publishing

26 views (last 30 days)
Fuad
Fuad on 16 Dec 2013
Answered: Michael on 20 Aug 2014
Hi, I am trying to stop matlab from wrapping a dataset when I publish the results, but cant seem to do it...
I have a dataset with 7 columns and a couple of rows, and in the editor I can display it like this:
disp(spread)
Result
Leg LegWeight PriceRatio TradeRatios RoundedTR RoundedPR IndexedByLeg1PR
'A' 1 0.49542 9.9085 10 0.5 1
'B' -1 -0.18005 -1.4404 -1 -0.125 -0.25
However when I publish the same code it splits the result into two seperate tables, like this:
Leg LegWeight PriceRatio TradeRatios RoundedTR
'A' 1 0.29853 5.0317 5
'B' -1 -0.49542 -9.9085 -10
RoundedPR IndexedByLeg1PR
0.29665 1
-0.5 -1.6855
Is there anyway to have the publish function do the same thing as the editor and not split my results?
Many thanks for your help.

  1 Comment

Fuad
Fuad on 16 Dec 2013
Ironically the website has word wrapped my question as well! The first result displays a single table of 7 columns and 2 rows (+headers).

Sign in to comment.

Answers (1)

Michael
Michael on 20 Aug 2014
It's been a while, so I'm not sure if you still are interested in this but I had the same issue so hopefully this will save others some time if they really need to do this.
I'm not sure how you would go about adjusting the width of the wrap setting, but if you want to disable it entirely here's what you can do.
Open up $matlabroot\toolbox\matlab\codetools\private\evalmxdom.m and search for 'EightyColumns'. You're going to want to comment out he following lines:
Lines 69-72:
% For consistency, set the published output to 80 columns, regardless of
% the current Command Window width.
originalEightyColumns = feature('EightyColumns');
resetEightyColumnsObj = onCleanup(...
@()feature('EightyColumns',originalEightyColumns) );
feature('EightyColumns',1)
Line 100:
delete(resetEightyColumnsObj);
That should do it. There's more info on that feature function at Undocumented MATLAB .

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by