Can you use the 'format long' command in the 'fprintf' command?
이전 댓글 표시
I would like to have variable 'x' formated using the 'format long' command when it is printed using fprintf. However, I am unable to place it between the % and f values of ('%f',x) since 'format long' begins with an f. I have tried using '.15' between % and f, however, the output values are not aligned when the numbers infront of the decimal place increase (see below). Can 'format long' be used in fprintf? If not, how can I keep the numbers in front of the decimal place the same length (in this example, '08' for the last three entries)?
sqrt of a (x) error(e) iteration(s)
32.500000000000000 9.923e+02 1
17.234615384615385 2.330e+02 2
10.474036101145005 4.571e+01 3
8.292191785986859 4.760e+00 4
8.005147977880979 8.239e-02 5
8.000001655289593 2.648e-05 6
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!