(stop) Wrapping output when publishing

조회 수: 3 (최근 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