Posted by admin | Posted in Baseball | Posted on 03-01-2011
Tags: 3d, art, cube display, cube display boxes, cube display case, cube display shelves, cube display unit, electronics, hardware, led
| Account limit of 2000 requests per hour exceeded. |
How can I write a MATLAB script using loops that does the following:?
Write a program in a script file that finds the smallest even integer that is also divisible by 7 and whose cube is greater than 40,000. The loop should start from 1 and stop when the number is found. The program should then display the number.
I know that I need to use a "while loop" but I'm very confused about how to implement the other requirements.
Thanks in advance for any advice!
I'm not totally familiar with MATLAB scripting, its not elegant by any means and some of the output might be weird, but if you stick it into a function it should get the job done.
n = 0;
stop = 0;
while stop ~= 1
n = n+2;
if mod(n,7) = 0
if n^3 > 40000
stop = 1;
end
end
end
n
