Filter löschen
Filter löschen

eliminate all exponential part in the matrix

1 Ansicht (letzte 30 Tage)
Elysi Cochin
Elysi Cochin am 5 Feb. 2014
Beantwortet: Mischa Kim am 5 Feb. 2014
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....

Akzeptierte Antwort

Mischa Kim
Mischa Kim am 5 Feb. 2014
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

Weitere Antworten (0)

Kategorien

Mehr zu Numeric Types finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by