format long does not work in a function

8 ビュー (過去 30 日間)
marziye ghasemi
marziye ghasemi 2018 年 11 月 26 日
回答済み: Steven Lord 2018 年 11 月 27 日
i have a function and i need the calculation in long format , i added :
origFormat = get(0, 'format');
format('long');
% -- Work in long format --
set(0,'format', origFormat);
at first line but it doesnt work
  1 件のコメント
Stephen23
Stephen23 2018 年 11 月 26 日
編集済み: Stephen23 2018 年 11 月 26 日
"at first line but it doesnt work"
What do you expect this to do, and how did you test it?
What does "Work in long format" mean exactly?
Does your code display anything in the command window?

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

回答 (1 件)

Steven Lord
Steven Lord 2018 年 11 月 27 日
The format function changes how double and single precision numbers are displayed. It has no impact on how computations are performed with those numbers, nor will it affect how sym expressions are displayed. To affect how sym expressions are displayed call vpa on the expressions.

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by