Cody

Problem 2392. Find the coefficient of a number in scientifc notation

Solution 2984347

Submitted on 23 Sep 2020 by David Hill
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
[C,E] = scientific_notation(1); assert(abs(C-1)<10^(-10) & isequal(E,0))

2   Pass
[C,E] = scientific_notation(100); assert(abs(C-1)<10^(-10) & isequal(E,2))

3   Pass
[C,E] = scientific_notation(.0055); assert(abs(C-5.5)<10^(-10) & isequal(E,-3))

4   Pass
[C,E] = scientific_notation(3^20); assert(abs(C-3.486784401)<10^(-10) & isequal(E,9))

Suggested Problems

More from this Author1

Community Treasure Hunt

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

Start Hunting!