필터 지우기
필터 지우기

eliminate all exponential part in the matrix

조회 수: 1 (최근 30일)
Elysi Cochin
Elysi Cochin 2014년 2월 5일
답변: Mischa Kim 2014년 2월 5일
i have a matrix with values as shown in the link....
i want to eliminate all the exponential part that is
if the value is -0.0099 leave as it is,
but if it is 9.1940e-04 i want to keep only 9.1940.....
what should i do.... please do reply....

채택된 답변

Mischa Kim
Mischa Kim 2014년 2월 5일
Elysi, one option would be to convert matrix values to strings (or read as strings from file) and crop, if necessary:
if ~isempty(strfind(val,'e'))
val_new = str2num(val(1:strfind(val,'e')-1))
else
val_new = str2num(val)
end

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by