Determine how format was set for compact versus loose

I have several toolboxes that overload the disp function, like vpi, hpf, sympoly, vpij, etc. I'd like to have my code learn what the format settings are to customize the output in a consistent way based on the format setting. Thus
get(0,'format')
ans =
shortG
tells me the current format setting. However, I'd like to know if compact or loose was set too. As far as I can see from the doc for format which tells us about the above trick, this is not possible for compact versus loose.
To be honest, I really think that format should tell me this directly. Thus I SHOULD be able to do this:
F = format
Error using format
Too many output arguments.
and have it return a struct that includes any format settings. As you see, that is not an option.

4 件のコメント

Cedric
Cedric 2014 年 6 月 30 日
編集済み: Cedric 2014 年 6 月 30 日
-> answer
Jan
Jan 2014 年 6 月 30 日
@Cedric: Please post this as an answer. It was the same property under Matlab 5 also and it still is for R2014a.
Cedric
Cedric 2014 年 6 月 30 日
Hi Jan, and thank you for the information about former versions!
John D'Errico
John D'Errico 2014 年 6 月 30 日
It is that way in 2014b too, not that I know where to look.

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

 採用された回答

Cedric
Cedric 2014 年 6 月 30 日

4 投票

On my R2013b, 'compact' and 'loose' are values of property FormatSpacing.
>> get( 0, 'FormatSpacing' )
ans =
compact

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by