필터 지우기
필터 지우기

Export number with fewer decimals and a number in parentheses

조회 수: 1 (최근 30일)
Eric
Eric 2017년 11월 3일
답변: Star Strider 2017년 11월 3일
Hi everyone,
I currently have the following number in a 8x4 double. I want to turn this number: -0.6100 to the following: -0.61 (1.48) to export it to Latex. Is this possible?
Thanks a lot in advance.
Best regards,
Eric

답변 (1개)

Star Strider
Star Strider 2017년 11월 3일
See if the more recent versions of the round (link) function (that allow rounding to a specific number of decimal places) will do what you want.
If you don’t have it, use this emulation of it to round your variables to a specific number of decimal places:
roundn = @(x,n) round(x .* 10.^n)./10.^n; % Round ‘x’ To ‘n’ Digits, Emulates Latest ‘round’ Function

카테고리

Help CenterFile Exchange에서 LaTeX에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by