フィルターのクリア

Automatic resize of tables in MATLAB

9 ビュー (過去 30 日間)
Dejan Krajcar
Dejan Krajcar 2019 年 1 月 30 日
回答済み: Andre 2019 年 6 月 5 日
I have been unsuccesfulyl trying to resize MATLAB tables so that it would automatically fit column width to size of maximum value in the column.
There are some solutions posted but none are working for me.
Is there any simple solution for this problem?
BR; DEJan
  2 件のコメント
madhan ravi
madhan ravi 2019 年 1 月 30 日
illustrate with an example
Dejan Krajcar
Dejan Krajcar 2019 年 1 月 31 日
I am attaching mlx code and Example of an error in the attached picture.
Basically my COMBO variable has quite long values and I would like column to be automatically resized otherwise I cannot see the vaue in the pdf or html output.
My input is table defined in the data, so if you change that it should run (at least until the error)
This is a rather complicated way I found here
Otherwise, if ther is any simpler solution its great. Its strange if there is no simler solution....
BR; DEJan

サインインしてコメントする。

回答 (2 件)

Luna
Luna 2019 年 1 月 31 日
Have you tried java object written here?
jScroll = findjobj(hTable);
jTable = jScroll.getViewport.getView;
jTable.setAutoResizeMode(jTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
You can get findjobj function from FEX below link:

Andre
Andre 2019 年 6 月 5 日
Hi,
cellfun(@length, x) provides the lengths of the individual entries (without a loop). It does however not count the number of digits for a number....
Hope it helps,
Andre

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by