How can I cut some digits from a number?

How can I cut some digits from a number like this 0.0000005566?
How can I keep only the first 4 decimal digits?
I use vpa but this return something else.
b=0.0000005566
vpa(b,4)
ans =
5.566*10^(-7)
examples:
0.0000345->0
0.001234->0.0012
12.4234234->12.4234
121313.334242->121313.3342

댓글 수: 1

James Tursa
James Tursa 2011년 6월 26일
Can you give some examples of input and desired output?

댓글을 달려면 로그인하십시오.

 채택된 답변

Oleg Komarov
Oleg Komarov 2011년 6월 26일

1 개 추천

n = 121313.334242;
fix(n*10000)/10000

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2011년 6월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by