(stop) Wrapping output when publishing

5 次查看(过去 30 天)
Fuad
Fuad 2013-12-16
回答: Michael 2014-8-20
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 个评论
Fuad
Fuad 2013-12-16
Ironically the website has word wrapped my question as well! The first result displays a single table of 7 columns and 2 rows (+headers).

请先登录,再进行评论。

回答(1 个)

Michael
Michael 2014-8-20
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 .

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by