1
testVector =

   1.0e+10 *

    3.5688    3.1110    5.2349

Is it possible to take out the exponent (not sure what it's called) of a vector and store it as a variable? E.g. in this case the variable would have value 1.0e+10

eyes enberg
  • 556
  • 1
  • 8
  • 30

1 Answers1

5

You can find the value of the exponent using log10:

testVector = [3.5688e+10   3.1110e+10   5.2349e+10];
lowExp = min(floor(log10(testVector)));
eVal = 10^lowExp;

Result:

eVal =    1.0000e+10

Then you'll need to divide your original vector by eVal:

newTestV = testVector/eVal

newTestV =

   3.5688   3.1110   5.2349
beaker
  • 16,331
  • 3
  • 32
  • 49