Hlep change the program .As easy and automatic.

i=1;
while (100-2^i>0)
i=i+1;
end
k=i-1
e1=100-2^k
while (e1-2^k<0)
k=k-1;
end
k1=k
e2=e1-2^k1
while(e2-2^k1<0)
k1=k1-1;
end
k2=k1
e3=e2-2^k2

1 Comment

Please explain the problem with the code. Are you getting an error? Are you getting an unexpected result? Does this code run too slowly for your purpose?
You need to help explain all this to us, if you want us to help you.

Answers (0)

This question is closed.

Asked:

on 16 Jul 2015

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!