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 CenterFile Exchange에서 Conversion 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