필터 지우기
필터 지우기

Why can't I save very small numbers in a vector?

조회 수: 3 (최근 30일)
Joao
Joao 2014년 11월 9일
댓글: Neelima Dahal 2018년 7월 31일
Hello!
My code is getting points like 5e-9 and i am putting these points on a vector. However after i run it i get a vector full of zeros.
Is there anyway to keep the real numbers in the vector.
Thank you

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 11월 9일
a=1e-9
fprintf('%.10f',a)

추가 답변 (2개)

per isakson
per isakson 2014년 11월 9일
편집: per isakson 2014년 11월 9일
The small numbers are there, but not displayed. (My guess.) Try
>> format long
>> a = [1e9,1e-9]
a =
1.0e+09 *
1.000000000000000 0.000000000000000
>> a(2)
ans =
1.000000000000000e-09
>>

Joao
Joao 2014년 11월 9일
already solved the problem.it was something else. thank you
  댓글 수: 1
Neelima Dahal
Neelima Dahal 2018년 7월 31일
What was it? I am dealing with the same issue here.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by